Excel macros page breaks but not on row 1 and column value in footer

Hi, I have seen some posts that are similar, but no one seems to have
the problem that I am having. I will post my macro in this, for anyone
that is interested.

My users get a csv file every month, and we have to clean it up. This
macro does that.

My last issues are this:

1) having the spreadsheet create page breaks whenever the value in
column B changes. Below is just that code.

Code:
col = 2
LastRw = ActiveSheet.UsedRange.Rows.Count
For X = 2 To LastRw
If Cells(X, col) <> Cells(X - 1, col) And Cells(X, col) <> Range("B1")
Then
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(X, col)
End If
Next
----------------------------------


The problem that I am having, is that my first page is just row 1. I
have row 1 repeat at the top of every page. It does make sense in the
code that this value changes, so it makes a page break. Can anyone help
me to adjust my code so that it will ignore the first row when it makes
the page breaks? The value of B1 will always be the same, so my thought
is to make that "If ...Then" statement include something that says not
if Cells(X, col) = B1.  Make sense?

Second issue:

2) I want to take the value in column B, as it will be the same for any
given page due to the above page breaks, and put that in the footer.

I have commented out the code that I was having fun with trying. The
idea is that column B is a box number, and I want to have that box
number in the footer, so that it is easy to see on the sheet. Here is
my page setup code for headers and footers.

As I said, I commented out the right footer where I would put this
code. Any help would be great.


Code:
  With ActiveSheet.PageSetup
      .CenterHeader = "Our Form"
      .LeftFooter = Date
      .CenterFooter = "Signature __________________________________"
   ' this is where I want the value -->   .RightFooter = "Box Number: "
& Column("B:B").Value
    End With
---------------------------

>From the posts I have been reading, you cannot use formulas in the
footer.  I wish this was not true.  My idea was that many formulas or
functions could work here.  Because I break the page on the value in
this column any function that finds the value of any B column cell in
the page could be used in this right footer.  Like first or last would
work.

Anyway, if I cannot get this second part, I can still deploy the macro.
 I just need to fix the first part.

For anyone who is interested, here is my entire messy code. I started
off with what we had, recorded portions to do more, and added bits and
pieces together.
Be warned that I am not advanced at Excel macros, so it is a messy one.

It is not organized at all, but it works!

Code:
Sub MyCsvConvert()

    Application.ScreenUpdating = False
    Columns("A:B").Select
    Selection.Delete Shift:=xlToLeft
    ActiveCell.FormulaR1C1 = "Date " & Chr(10) & "Entered"
    With ActiveCell.Characters(Start:=1, Length:=13).Font
    End With
    Range("A1").Select
    With Selection
        .HorizontalAlignment = xlCenter
    End With
    Columns("B:B").Select
    Selection.Delete Shift:=xlToLeft
    ActiveCell.FormulaR1C1 = "SKP " & Chr(10) & "Box #"
    Columns("B:B").Select
    Selection.ColumnWidth = 9.2
    Range("B1").Select
    With Selection
        .HorizontalAlignment = xlRight
    End With
    Columns("C:G").Select
    Selection.Delete Shift:=xlToLeft
    ActiveCell.FormulaR1C1 = "Dept. #"
    Range("C1").Select
    With Selection
        .HorizontalAlignment = xlRight
    End With
    Columns("D:D").Select
    Selection.Delete Shift:=xlToLeft
    ActiveCell.FormulaR1C1 = "Record " & Chr(10) & "Code"
    With ActiveCell.Characters(Start:=1, Length:=12).Font
    End With
    Range("D1").Select
    With Selection
        .HorizontalAlignment = xlRight
    End With
    Columns("E:G").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:E").Select
    Selection.ColumnWidth = 9.17
    Range("E1").Select
    With Selection
    .HorizontalAlignment = xlCenter
    End With
    ActiveCell.FormulaR1C1 = "Destruction " & Chr(10) & "Date"
    With ActiveCell.Characters(Start:=1, Length:=17).Font
    End With
    Range("F1").Select
    Columns("F:F").ColumnWidth = 9.5
    Columns("F:G").Select
    With Selection
        .HorizontalAlignment = xlLeft
    End With
    Columns("H:I").Select
    Selection.Delete Shift:=xlToLeft
    Columns("H:H").Select
    Selection.ColumnWidth = 21.5
    'Columns("I:I").ColumnWidth = 21.5
    Columns("I:I").Select
    Selection.Delete Shift:=xlToLeft
    'ActiveWindow.SmallScroll ToRight:=6
    Columns("I:J").Select
    Selection.ColumnWidth = 21.5
    'Columns("K:K").ColumnWidth = 21.5
    Columns("K:M").Select
    Selection.Delete Shift:=xlToLeft
    ActiveWindow.LargeScroll ToRight:=-1
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "Depart #"
    Range("D1").Select
    ActiveCell.FormulaR1C1 = "Atty Number"
    Range("G1").Select
    ActiveCell.FormulaR1C1 = "Client Number"
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Matter Number"
    Range("H1").Select
    ActiveCell.FormulaR1C1 = "Client Name"
    Range("J1").Select
    ActiveCell.FormulaR1C1 = "Matter/File Descrip"
    Range("I1").Select
    ActiveCell.FormulaR1C1 = "Real/Est Collect Numer"
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "Closing Date"
        Columns("I:I").Select
    With Selection
        .HorizontalAlignment = xlLeft
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Columns("H:H").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Columns("J:J").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Columns("H:H").ColumnWidth = 34.57
    Rows("1:1").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Range("F1").Select
    Columns("F:F").EntireColumn.AutoFit
    Columns("G:G").EntireColumn.AutoFit
    Columns("H:H").EntireColumn.AutoFit
    Columns("I:I").EntireColumn.AutoFit
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 5
    ActiveWindow.ScrollColumn = 6
    ActiveWindow.ScrollColumn = 7
    ActiveWindow.View = xlPageBreakPreview
    ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
RegionIndex:=1
    ActiveWindow.LargeScroll ToRight:=-1
    Cells.Select
    Selection.Copy
    Workbooks.Add Template:="Workbook"
    ActiveSheet.Paste
    ActiveSheet.PageSetup.Orientation = xlLandscape
    With Worksheets(1).PageSetup
    .LeftMargin = Application.InchesToPoints(0.35)
    .RightMargin = Application.InchesToPoints(0.35)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    End With
    With ActiveSheet.PageSetup
        .PrintTitleRows = "$1:$1"
        .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintGridlines = True
    ActiveWindow.View = xlNormalView
       With ActiveSheet.PageSetup
      .CenterHeader = "Our Form"
      .LeftFooter = Date
      .CenterFooter = "Signature __________________________________"
   ' this is where I want the value -->   .RightFooter = "Box Number: "
& Column("B:B").Value
    End With
    Columns("A:A").EntireColumn.AutoFit
    Columns("B:B").EntireColumn.AutoFit
    Columns("C:C").EntireColumn.AutoFit
    Columns("D:D").EntireColumn.AutoFit
    Columns("E:E").EntireColumn.AutoFit
    Columns("F:F").EntireColumn.AutoFit
    Columns("G:G").EntireColumn.AutoFit
    Columns("H:H").EntireColumn.AutoFit
    Columns("I:I").EntireColumn.AutoFit
    Columns("J:J").EntireColumn.AutoFit
      Columns("F:F").ColumnWidth = 9.29
    Columns("F:F").ColumnWidth = 7
    Columns("F:F").ColumnWidth = 6.29
    Columns("F:F").ColumnWidth = 5.57
    Columns("F:F").EntireColumn.AutoFit
    Columns("F:F").Select
    With Selection
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Selection.ColumnWidth = 9.43
    Selection.ColumnWidth = 7.71
    Columns("G:G").Select
    With Selection
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Selection.ColumnWidth = 9.43
    Selection.ColumnWidth = 8
    Selection.ColumnWidth = 7.29
    Columns("I:I").Select
    With Selection
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Selection.ColumnWidth = 15.57
    Selection.ColumnWidth = 12.71
    Selection.ColumnWidth = 11
    Columns("J:J").ColumnWidth = 25.86
    Columns("J:J").ColumnWidth = 28.29
    Range("H2").Select
    ActiveCell.FormulaR1C1 = "M &amp; T MORTGAGE CORPORATION"
    With ActiveCell.Characters(Start:=1, Length:=30).Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    Cells.Replace What:="&amp;", Replacement:="&", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _

        ReplaceFormat:=False
    Rows("1:1").Select
    Selection.Font.Bold = True
    Range("D1").Select
    Columns("D:D").ColumnWidth = 7.71
    Columns("E:E").ColumnWidth = 7.43
    Range("I1").Select
    With ActiveSheet.PageSetup
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = False
    End With
     Columns("B:B").Select
    Range("A1:J81").sort Key1:=Range("B2"), Order1:=xlAscending,
Header:= _
        xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
      col = 2
LastRw = ActiveSheet.UsedRange.Rows.Count
For X = 2 To LastRw
If Cells(X, col) <> Cells(X - 1, col) And Cells(X, col) <> Range("B1")
Then
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(X, col)
End If
Next
If Not ActiveWorkbook.Saved Then
ThisWorkbook.Saved = True
ThisWorkbook.Close
End If 

End Sub 
---------------------------------

Thanks!

0
misscrf1 (8)
10/6/2005 6:55:48 PM
excel 39879 articles. 2 followers. Follow

3 Replies
482 Views

Similar Articles

[PageSpeed] 45

crf,

One thing to keep in mind is that the code is going through the sheet 
putting in page breaks, not through pages.  So the rows to repeat at top 
shouldn't be involved.  I think you can change it to:

For X = 3 to lastRw

As for the second part, the same thing applies.  Anything you put in the 
footer is for the whole print job.  And footers aren't dynamic (can't pick 
up changing data).  One possibility is to print each group of col B values 
as a separate print job, setting the footer as desired in code each time. 
This may create a lot of separator pages if this is a network printer.  You 
wouldn't need the page breaks in the part 1 code for this solution.  You 
could do it by setting the print area for the group to be printed, or by 
hiding the rows that shouldn't print, or by copying the rows to another 
sheet and printing that.

--
Earl Kiosterud
www.smokeylake.com

"misscrf" <misscrf@yahoo.com> wrote in message 
news:1128624948.773350.213120@o13g2000cwo.googlegroups.com...
> Hi, I have seen some posts that are similar, but no one seems to have
> the problem that I am having. I will post my macro in this, for anyone
> that is interested.
>
> My users get a csv file every month, and we have to clean it up. This
> macro does that.
>
> My last issues are this:
>
> 1) having the spreadsheet create page breaks whenever the value in
> column B changes. Below is just that code.
>
> Code:
> col = 2
> LastRw = ActiveSheet.UsedRange.Rows.Count
> For X = 2 To LastRw
> If Cells(X, col) <> Cells(X - 1, col) And Cells(X, col) <> Range("B1")
> Then
> ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(X, col)
> End If
> Next
> ----------------------------------
>
>
> The problem that I am having, is that my first page is just row 1. I
> have row 1 repeat at the top of every page. It does make sense in the
> code that this value changes, so it makes a page break. Can anyone help
> me to adjust my code so that it will ignore the first row when it makes
> the page breaks? The value of B1 will always be the same, so my thought
> is to make that "If ...Then" statement include something that says not
> if Cells(X, col) = B1.  Make sense?
>
> Second issue:
>
> 2) I want to take the value in column B, as it will be the same for any
> given page due to the above page breaks, and put that in the footer.
>
> I have commented out the code that I was having fun with trying. The
> idea is that column B is a box number, and I want to have that box
> number in the footer, so that it is easy to see on the sheet. Here is
> my page setup code for headers and footers.
>
> As I said, I commented out the right footer where I would put this
> code. Any help would be great.
>
>
> Code:
>  With ActiveSheet.PageSetup
>      .CenterHeader = "Our Form"
>      .LeftFooter = Date
>      .CenterFooter = "Signature __________________________________"
>   ' this is where I want the value -->   .RightFooter = "Box Number: "
> & Column("B:B").Value
>    End With
> ---------------------------
>
>>From the posts I have been reading, you cannot use formulas in the
> footer.  I wish this was not true.  My idea was that many formulas or
> functions could work here.  Because I break the page on the value in
> this column any function that finds the value of any B column cell in
> the page could be used in this right footer.  Like first or last would
> work.
>
> Anyway, if I cannot get this second part, I can still deploy the macro.
> I just need to fix the first part.
>
> For anyone who is interested, here is my entire messy code. I started
> off with what we had, recorded portions to do more, and added bits and
> pieces together.
> Be warned that I am not advanced at Excel macros, so it is a messy one.
>
> It is not organized at all, but it works!
>
> Code:
> Sub MyCsvConvert()
>
>    Application.ScreenUpdating = False
>    Columns("A:B").Select
>    Selection.Delete Shift:=xlToLeft
>    ActiveCell.FormulaR1C1 = "Date " & Chr(10) & "Entered"
>    With ActiveCell.Characters(Start:=1, Length:=13).Font
>    End With
>    Range("A1").Select
>    With Selection
>        .HorizontalAlignment = xlCenter
>    End With
>    Columns("B:B").Select
>    Selection.Delete Shift:=xlToLeft
>    ActiveCell.FormulaR1C1 = "SKP " & Chr(10) & "Box #"
>    Columns("B:B").Select
>    Selection.ColumnWidth = 9.2
>    Range("B1").Select
>    With Selection
>        .HorizontalAlignment = xlRight
>    End With
>    Columns("C:G").Select
>    Selection.Delete Shift:=xlToLeft
>    ActiveCell.FormulaR1C1 = "Dept. #"
>    Range("C1").Select
>    With Selection
>        .HorizontalAlignment = xlRight
>    End With
>    Columns("D:D").Select
>    Selection.Delete Shift:=xlToLeft
>    ActiveCell.FormulaR1C1 = "Record " & Chr(10) & "Code"
>    With ActiveCell.Characters(Start:=1, Length:=12).Font
>    End With
>    Range("D1").Select
>    With Selection
>        .HorizontalAlignment = xlRight
>    End With
>    Columns("E:G").Select
>    Selection.Delete Shift:=xlToLeft
>    Columns("E:E").Select
>    Selection.ColumnWidth = 9.17
>    Range("E1").Select
>    With Selection
>    .HorizontalAlignment = xlCenter
>    End With
>    ActiveCell.FormulaR1C1 = "Destruction " & Chr(10) & "Date"
>    With ActiveCell.Characters(Start:=1, Length:=17).Font
>    End With
>    Range("F1").Select
>    Columns("F:F").ColumnWidth = 9.5
>    Columns("F:G").Select
>    With Selection
>        .HorizontalAlignment = xlLeft
>    End With
>    Columns("H:I").Select
>    Selection.Delete Shift:=xlToLeft
>    Columns("H:H").Select
>    Selection.ColumnWidth = 21.5
>    'Columns("I:I").ColumnWidth = 21.5
>    Columns("I:I").Select
>    Selection.Delete Shift:=xlToLeft
>    'ActiveWindow.SmallScroll ToRight:=6
>    Columns("I:J").Select
>    Selection.ColumnWidth = 21.5
>    'Columns("K:K").ColumnWidth = 21.5
>    Columns("K:M").Select
>    Selection.Delete Shift:=xlToLeft
>    ActiveWindow.LargeScroll ToRight:=-1
>    Range("C1").Select
>    ActiveCell.FormulaR1C1 = "Depart #"
>    Range("D1").Select
>    ActiveCell.FormulaR1C1 = "Atty Number"
>    Range("G1").Select
>    ActiveCell.FormulaR1C1 = "Client Number"
>    Range("F1").Select
>    ActiveCell.FormulaR1C1 = "Matter Number"
>    Range("H1").Select
>    ActiveCell.FormulaR1C1 = "Client Name"
>    Range("J1").Select
>    ActiveCell.FormulaR1C1 = "Matter/File Descrip"
>    Range("I1").Select
>    ActiveCell.FormulaR1C1 = "Real/Est Collect Numer"
>    Range("E1").Select
>    ActiveCell.FormulaR1C1 = "Closing Date"
>        Columns("I:I").Select
>    With Selection
>        .HorizontalAlignment = xlLeft
>        .VerticalAlignment = xlBottom
>        .WrapText = False
>        .Orientation = 0
>        .AddIndent = False
>        .IndentLevel = 0
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Columns("H:H").Select
>    With Selection
>        .HorizontalAlignment = xlGeneral
>        .VerticalAlignment = xlBottom
>        .WrapText = True
>        .Orientation = 0
>        .AddIndent = False
>        .IndentLevel = 0
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Columns("J:J").Select
>    With Selection
>        .HorizontalAlignment = xlGeneral
>        .VerticalAlignment = xlBottom
>        .WrapText = True
>        .Orientation = 0
>        .AddIndent = False
>        .IndentLevel = 0
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Columns("H:H").ColumnWidth = 34.57
>    Rows("1:1").Select
>    With Selection
>        .HorizontalAlignment = xlGeneral
>        .VerticalAlignment = xlBottom
>        .Orientation = 0
>        .AddIndent = False
>        .IndentLevel = 0
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Range("F1").Select
>    Columns("F:F").EntireColumn.AutoFit
>    Columns("G:G").EntireColumn.AutoFit
>    Columns("H:H").EntireColumn.AutoFit
>    Columns("I:I").EntireColumn.AutoFit
>    ActiveWindow.ScrollColumn = 2
>    ActiveWindow.ScrollColumn = 3
>    ActiveWindow.ScrollColumn = 4
>    ActiveWindow.ScrollColumn = 5
>    ActiveWindow.ScrollColumn = 6
>    ActiveWindow.ScrollColumn = 7
>    ActiveWindow.View = xlPageBreakPreview
>    ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
> RegionIndex:=1
>    ActiveWindow.LargeScroll ToRight:=-1
>    Cells.Select
>    Selection.Copy
>    Workbooks.Add Template:="Workbook"
>    ActiveSheet.Paste
>    ActiveSheet.PageSetup.Orientation = xlLandscape
>    With Worksheets(1).PageSetup
>    .LeftMargin = Application.InchesToPoints(0.35)
>    .RightMargin = Application.InchesToPoints(0.35)
>    .TopMargin = Application.InchesToPoints(1)
>    .BottomMargin = Application.InchesToPoints(1)
>    .HeaderMargin = Application.InchesToPoints(0.5)
>    .FooterMargin = Application.InchesToPoints(0.5)
>    End With
>    With ActiveSheet.PageSetup
>        .PrintTitleRows = "$1:$1"
>        .PrintTitleColumns = ""
>    End With
>    ActiveSheet.PageSetup.PrintGridlines = True
>    ActiveWindow.View = xlNormalView
>       With ActiveSheet.PageSetup
>      .CenterHeader = "Our Form"
>      .LeftFooter = Date
>      .CenterFooter = "Signature __________________________________"
>   ' this is where I want the value -->   .RightFooter = "Box Number: "
> & Column("B:B").Value
>    End With
>    Columns("A:A").EntireColumn.AutoFit
>    Columns("B:B").EntireColumn.AutoFit
>    Columns("C:C").EntireColumn.AutoFit
>    Columns("D:D").EntireColumn.AutoFit
>    Columns("E:E").EntireColumn.AutoFit
>    Columns("F:F").EntireColumn.AutoFit
>    Columns("G:G").EntireColumn.AutoFit
>    Columns("H:H").EntireColumn.AutoFit
>    Columns("I:I").EntireColumn.AutoFit
>    Columns("J:J").EntireColumn.AutoFit
>      Columns("F:F").ColumnWidth = 9.29
>    Columns("F:F").ColumnWidth = 7
>    Columns("F:F").ColumnWidth = 6.29
>    Columns("F:F").ColumnWidth = 5.57
>    Columns("F:F").EntireColumn.AutoFit
>    Columns("F:F").Select
>    With Selection
>        .VerticalAlignment = xlBottom
>        .WrapText = True
>        .Orientation = 0
>        .AddIndent = False
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Selection.ColumnWidth = 9.43
>    Selection.ColumnWidth = 7.71
>    Columns("G:G").Select
>    With Selection
>        .VerticalAlignment = xlBottom
>        .WrapText = True
>        .Orientation = 0
>        .AddIndent = False
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Selection.ColumnWidth = 9.43
>    Selection.ColumnWidth = 8
>    Selection.ColumnWidth = 7.29
>    Columns("I:I").Select
>    With Selection
>        .VerticalAlignment = xlBottom
>        .WrapText = True
>        .Orientation = 0
>        .AddIndent = False
>        .ShrinkToFit = False
>        .ReadingOrder = xlContext
>        .MergeCells = False
>    End With
>    Selection.ColumnWidth = 15.57
>    Selection.ColumnWidth = 12.71
>    Selection.ColumnWidth = 11
>    Columns("J:J").ColumnWidth = 25.86
>    Columns("J:J").ColumnWidth = 28.29
>    Range("H2").Select
>    ActiveCell.FormulaR1C1 = "M &amp; T MORTGAGE CORPORATION"
>    With ActiveCell.Characters(Start:=1, Length:=30).Font
>        .Name = "Arial"
>        .FontStyle = "Regular"
>        .Size = 10
>        .Strikethrough = False
>        .Superscript = False
>        .Subscript = False
>        .OutlineFont = False
>        .Shadow = False
>        .Underline = xlUnderlineStyleNone
>        .ColorIndex = xlAutomatic
>    End With
>    Cells.Replace What:="&amp;", Replacement:="&", LookAt:=xlPart, _
>        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
>
>        ReplaceFormat:=False
>    Rows("1:1").Select
>    Selection.Font.Bold = True
>    Range("D1").Select
>    Columns("D:D").ColumnWidth = 7.71
>    Columns("E:E").ColumnWidth = 7.43
>    Range("I1").Select
>    With ActiveSheet.PageSetup
>        .Zoom = False
>        .FitToPagesWide = 1
>        .FitToPagesTall = False
>    End With
>     Columns("B:B").Select
>    Range("A1:J81").sort Key1:=Range("B2"), Order1:=xlAscending,
> Header:= _
>        xlGuess, OrderCustom:=1, MatchCase:=False,
> Orientation:=xlTopToBottom, _
>        DataOption1:=xlSortNormal
>      col = 2
> LastRw = ActiveSheet.UsedRange.Rows.Count
> For X = 2 To LastRw
> If Cells(X, col) <> Cells(X - 1, col) And Cells(X, col) <> Range("B1")
> Then
> ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(X, col)
> End If
> Next
> If Not ActiveWorkbook.Saved Then
> ThisWorkbook.Saved = True
> ThisWorkbook.Close
> End If
>
> End Sub
> ---------------------------------
>
> Thanks!
> 


0
someone798 (944)
10/7/2005 2:39:55 PM
crf,

Another possibility that comes to mind is to separate the groups into 
sheets, setting the footers as desired for each sheet, then print the 
workbook.  One print job, getting around the multiple-print-job issue, like 
with the separator pages.  This might get a bit unwieldy if you have a lot 
of groups, but there's no limit as to how many sheets a workbook can have. 
We can help with the code.
--
Earl Kiosterud
www.smokeylake.com

"Earl Kiosterud" <someone@nowhere.com> wrote in message 
news:e4vRyy0yFHA.3256@TK2MSFTNGP09.phx.gbl...
> crf,
>
> One thing to keep in mind is that the code is going through the sheet 
> putting in page breaks, not through pages.  So the rows to repeat at top 
> shouldn't be involved.  I think you can change it to:
>
> For X = 3 to lastRw
>
> As for the second part, the same thing applies.  Anything you put in the 
> footer is for the whole print job.  And footers aren't dynamic (can't pick 
> up changing data).  One possibility is to print each group of col B values 
> as a separate print job, setting the footer as desired in code each time. 
> This may create a lot of separator pages if this is a network printer. 
> You wouldn't need the page breaks in the part 1 code for this solution. 
> You could do it by setting the print area for the group to be printed, or 
> by hiding the rows that shouldn't print, or by copying the rows to another 
> sheet and printing that.
>
> --
> Earl Kiosterud
> www.smokeylake.com
>
> "misscrf" <misscrf@yahoo.com> wrote in message 
> news:1128624948.773350.213120@o13g2000cwo.googlegroups.com...
>> Hi, I have seen some posts that are similar, but no one seems to have
>> the problem that I am having. I will post my macro in this, for anyone
>> that is interested.
>>
>> My users get a csv file every month, and we have to clean it up. This
>> macro does that.
>>
>> My last issues are this:
>>
>> 1) having the spreadsheet create page breaks whenever the value in
>> column B changes. Below is just that code.
>>
>> Code:
>> col = 2
>> LastRw = ActiveSheet.UsedRange.Rows.Count
>> For X = 2 To LastRw
>> If Cells(X, col) <> Cells(X - 1, col) And Cells(X, col) <> Range("B1")
>> Then
>> ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(X, col)
>> End If
>> Next
>> ----------------------------------
>>
>>
>> The problem that I am having, is that my first page is just row 1. I
>> have row 1 repeat at the top of every page. It does make sense in the
>> code that this value changes, so it makes a page break. Can anyone help
>> me to adjust my code so that it will ignore the first row when it makes
>> the page breaks? The value of B1 will always be the same, so my thought
>> is to make that "If ...Then" statement include something that says not
>> if Cells(X, col) = B1.  Make sense?
>>
>> Second issue:
>>
>> 2) I want to take the value in column B, as it will be the same for any
>> given page due to the above page breaks, and put that in the footer.
>>
>> I have commented out the code that I was having fun with trying. The
>> idea is that column B is a box number, and I want to have that box
>> number in the footer, so that it is easy to see on the sheet. Here is
>> my page setup code for headers and footers.
>>
>> As I said, I commented out the right footer where I would put this
>> code. Any help would be great.
>>
>>
>> Code:
>>  With ActiveSheet.PageSetup
>>      .CenterHeader = "Our Form"
>>      .LeftFooter = Date
>>      .CenterFooter = "Signature __________________________________"
>>   ' this is where I want the value -->   .RightFooter = "Box Number: "
>> & Column("B:B").Value
>>    End With
>> ---------------------------
>>
>>>From the posts I have been reading, you cannot use formulas in the
>> footer.  I wish this was not true.  My idea was that many formulas or
>> functions could work here.  Because I break the page on the value in
>> this column any function that finds the value of any B column cell in
>> the page could be used in this right footer.  Like first or last would
>> work.
>>
>> Anyway, if I cannot get this second part, I can still deploy the macro.
>> I just need to fix the first part.
>>
>> For anyone who is interested, here is my entire messy code. I started
>> off with what we had, recorded portions to do more, and added bits and
>> pieces together.
>> Be warned that I am not advanced at Excel macros, so it is a messy one.
>>
>> It is not organized at all, but it works!
>>
>> Code:
>> Sub MyCsvConvert()
>>
>>    Application.ScreenUpdating = False
>>    Columns("A:B").Select
>>    Selection.Delete Shift:=xlToLeft
>>    ActiveCell.FormulaR1C1 = "Date " & Chr(10) & "Entered"
>>    With ActiveCell.Characters(Start:=1, Length:=13).Font
>>    End With
>>    Range("A1").Select
>>    With Selection
>>        .HorizontalAlignment = xlCenter
>>    End With
>>    Columns("B:B").Select
>>    Selection.Delete Shift:=xlToLeft
>>    ActiveCell.FormulaR1C1 = "SKP " & Chr(10) & "Box #"
>>    Columns("B:B").Select
>>    Selection.ColumnWidth = 9.2
>>    Range("B1").Select
>>    With Selection
>>        .HorizontalAlignment = xlRight
>>    End With
>>    Columns("C:G").Select
>>    Selection.Delete Shift:=xlToLeft
>>    ActiveCell.FormulaR1C1 = "Dept. #"
>>    Range("C1").Select
>>    With Selection
>>        .HorizontalAlignment = xlRight
>>    End With
>>    Columns("D:D").Select
>>    Selection.Delete Shift:=xlToLeft
>>    ActiveCell.FormulaR1C1 = "Record " & Chr(10) & "Code"
>>    With ActiveCell.Characters(Start:=1, Length:=12).Font
>>    End With
>>    Range("D1").Select
>>    With Selection
>>        .HorizontalAlignment = xlRight
>>    End With
>>    Columns("E:G").Select
>>    Selection.Delete Shift:=xlToLeft
>>    Columns("E:E").Select
>>    Selection.ColumnWidth = 9.17
>>    Range("E1").Select
>>    With Selection
>>    .HorizontalAlignment = xlCenter
>>    End With
>>    ActiveCell.FormulaR1C1 = "Destruction " & Chr(10) & "Date"
>>    With ActiveCell.Characters(Start:=1, Length:=17).Font
>>    End With
>>    Range("F1").Select
>>    Columns("F:F").ColumnWidth = 9.5
>>    Columns("F:G").Select
>>    With Selection
>>        .HorizontalAlignment = xlLeft
>>    End With
>>    Columns("H:I").Select
>>    Selection.Delete Shift:=xlToLeft
>>    Columns("H:H").Select
>>    Selection.ColumnWidth = 21.5
>>    'Columns("I:I").ColumnWidth = 21.5
>>    Columns("I:I").Select
>>    Selection.Delete Shift:=xlToLeft
>>    'ActiveWindow.SmallScroll ToRight:=6
>>    Columns("I:J").Select
>>    Selection.ColumnWidth = 21.5
>>    'Columns("K:K").ColumnWidth = 21.5
>>    Columns("K:M").Select
>>    Selection.Delete Shift:=xlToLeft
>>    ActiveWindow.LargeScroll ToRight:=-1
>>    Range("C1").Select
>>    ActiveCell.FormulaR1C1 = "Depart #"
>>    Range("D1").Select
>>    ActiveCell.FormulaR1C1 = "Atty Number"
>>    Range("G1").Select
>>    ActiveCell.FormulaR1C1 = "Client Number"
>>    Range("F1").Select
>>    ActiveCell.FormulaR1C1 = "Matter Number"
>>    Range("H1").Select
>>    ActiveCell.FormulaR1C1 = "Client Name"
>>    Range("J1").Select
>>    ActiveCell.FormulaR1C1 = "Matter/File Descrip"
>>    Range("I1").Select
>>    ActiveCell.FormulaR1C1 = "Real/Est Collect Numer"
>>    Range("E1").Select
>>    ActiveCell.FormulaR1C1 = "Closing Date"
>>        Columns("I:I").Select
>>    With Selection
>>        .HorizontalAlignment = xlLeft
>>        .VerticalAlignment = xlBottom
>>        .WrapText = False
>>        .Orientation = 0
>>        .AddIndent = False
>>        .IndentLevel = 0
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Columns("H:H").Select
>>    With Selection
>>        .HorizontalAlignment = xlGeneral
>>        .VerticalAlignment = xlBottom
>>        .WrapText = True
>>        .Orientation = 0
>>        .AddIndent = False
>>        .IndentLevel = 0
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Columns("J:J").Select
>>    With Selection
>>        .HorizontalAlignment = xlGeneral
>>        .VerticalAlignment = xlBottom
>>        .WrapText = True
>>        .Orientation = 0
>>        .AddIndent = False
>>        .IndentLevel = 0
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Columns("H:H").ColumnWidth = 34.57
>>    Rows("1:1").Select
>>    With Selection
>>        .HorizontalAlignment = xlGeneral
>>        .VerticalAlignment = xlBottom
>>        .Orientation = 0
>>        .AddIndent = False
>>        .IndentLevel = 0
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Range("F1").Select
>>    Columns("F:F").EntireColumn.AutoFit
>>    Columns("G:G").EntireColumn.AutoFit
>>    Columns("H:H").EntireColumn.AutoFit
>>    Columns("I:I").EntireColumn.AutoFit
>>    ActiveWindow.ScrollColumn = 2
>>    ActiveWindow.ScrollColumn = 3
>>    ActiveWindow.ScrollColumn = 4
>>    ActiveWindow.ScrollColumn = 5
>>    ActiveWindow.ScrollColumn = 6
>>    ActiveWindow.ScrollColumn = 7
>>    ActiveWindow.View = xlPageBreakPreview
>>    ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
>> RegionIndex:=1
>>    ActiveWindow.LargeScroll ToRight:=-1
>>    Cells.Select
>>    Selection.Copy
>>    Workbooks.Add Template:="Workbook"
>>    ActiveSheet.Paste
>>    ActiveSheet.PageSetup.Orientation = xlLandscape
>>    With Worksheets(1).PageSetup
>>    .LeftMargin = Application.InchesToPoints(0.35)
>>    .RightMargin = Application.InchesToPoints(0.35)
>>    .TopMargin = Application.InchesToPoints(1)
>>    .BottomMargin = Application.InchesToPoints(1)
>>    .HeaderMargin = Application.InchesToPoints(0.5)
>>    .FooterMargin = Application.InchesToPoints(0.5)
>>    End With
>>    With ActiveSheet.PageSetup
>>        .PrintTitleRows = "$1:$1"
>>        .PrintTitleColumns = ""
>>    End With
>>    ActiveSheet.PageSetup.PrintGridlines = True
>>    ActiveWindow.View = xlNormalView
>>       With ActiveSheet.PageSetup
>>      .CenterHeader = "Our Form"
>>      .LeftFooter = Date
>>      .CenterFooter = "Signature __________________________________"
>>   ' this is where I want the value -->   .RightFooter = "Box Number: "
>> & Column("B:B").Value
>>    End With
>>    Columns("A:A").EntireColumn.AutoFit
>>    Columns("B:B").EntireColumn.AutoFit
>>    Columns("C:C").EntireColumn.AutoFit
>>    Columns("D:D").EntireColumn.AutoFit
>>    Columns("E:E").EntireColumn.AutoFit
>>    Columns("F:F").EntireColumn.AutoFit
>>    Columns("G:G").EntireColumn.AutoFit
>>    Columns("H:H").EntireColumn.AutoFit
>>    Columns("I:I").EntireColumn.AutoFit
>>    Columns("J:J").EntireColumn.AutoFit
>>      Columns("F:F").ColumnWidth = 9.29
>>    Columns("F:F").ColumnWidth = 7
>>    Columns("F:F").ColumnWidth = 6.29
>>    Columns("F:F").ColumnWidth = 5.57
>>    Columns("F:F").EntireColumn.AutoFit
>>    Columns("F:F").Select
>>    With Selection
>>        .VerticalAlignment = xlBottom
>>        .WrapText = True
>>        .Orientation = 0
>>        .AddIndent = False
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Selection.ColumnWidth = 9.43
>>    Selection.ColumnWidth = 7.71
>>    Columns("G:G").Select
>>    With Selection
>>        .VerticalAlignment = xlBottom
>>        .WrapText = True
>>        .Orientation = 0
>>        .AddIndent = False
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Selection.ColumnWidth = 9.43
>>    Selection.ColumnWidth = 8
>>    Selection.ColumnWidth = 7.29
>>    Columns("I:I").Select
>>    With Selection
>>        .VerticalAlignment = xlBottom
>>        .WrapText = True
>>        .Orientation = 0
>>        .AddIndent = False
>>        .ShrinkToFit = False
>>        .ReadingOrder = xlContext
>>        .MergeCells = False
>>    End With
>>    Selection.ColumnWidth = 15.57
>>    Selection.ColumnWidth = 12.71
>>    Selection.ColumnWidth = 11
>>    Columns("J:J").ColumnWidth = 25.86
>>    Columns("J:J").ColumnWidth = 28.29
>>    Range("H2").Select
>>    ActiveCell.FormulaR1C1 = "M &amp; T MORTGAGE CORPORATION"
>>    With ActiveCell.Characters(Start:=1, Length:=30).Font
>>        .Name = "Arial"
>>        .FontStyle = "Regular"
>>        .Size = 10
>>        .Strikethrough = False
>>        .Superscript = False
>>        .Subscript = False
>>        .OutlineFont = False
>>        .Shadow = False
>>        .Underline = xlUnderlineStyleNone
>>        .ColorIndex = xlAutomatic
>>    End With
>>    Cells.Replace What:="&amp;", Replacement:="&", LookAt:=xlPart, _
>>        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
>>
>>        ReplaceFormat:=False
>>    Rows("1:1").Select
>>    Selection.Font.Bold = True
>>    Range("D1").Select
>>    Columns("D:D").ColumnWidth = 7.71
>>    Columns("E:E").ColumnWidth = 7.43
>>    Range("I1").Select
>>    With ActiveSheet.PageSetup
>>        .Zoom = False
>>        .FitToPagesWide = 1
>>        .FitToPagesTall = False
>>    End With
>>     Columns("B:B").Select
>>    Range("A1:J81").sort Key1:=Range("B2"), Order1:=xlAscending,
>> Header:= _
>>        xlGuess, OrderCustom:=1, MatchCase:=False,
>> Orientation:=xlTopToBottom, _
>>        DataOption1:=xlSortNormal
>>      col = 2
>> LastRw = ActiveSheet.UsedRange.Rows.Count
>> For X = 2 To LastRw
>> If Cells(X, col) <> Cells(X - 1, col) And Cells(X, col) <> Range("B1")
>> Then
>> ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(X, col)
>> End If
>> Next
>> If Not ActiveWorkbook.Saved Then
>> ThisWorkbook.Saved = True
>> ThisWorkbook.Close
>> End If
>>
>> End Sub
>> ---------------------------------
>>
>> Thanks!
>>
>
> 


0
someone798 (944)
10/7/2005 3:16:48 PM
These sound like good suggestions, thanks.  I got better code for the
page breaks.  I think I may have to give up on the footer.

Here is my amended code for the page breaks:

 Dim FromSheet As Worksheet
    Dim LastRow As Long
    Dim MyValue As Variant
    Dim EndPage As Range
    '----------------------------------------------------
    Set FromSheet = Worksheets("Sheet1")
    LastRow = FromSheet.Range("A65536").End(xlUp).Row
    FromRow = 2
    '-----------------------------------------------------
    '- main loop
    Do
        MyValue = FromSheet.Cells(FromRow, 2).Value
        '- start ToSheet anew
        ToRow = 2
        '--------------------------------------------------------------
        '- set page breaks
        While FromSheet.Cells(FromRow, 2).Value = MyValue
            FromRow = FromRow + 1
        Wend
        Set EndPage = FromSheet.Cells(FromRow, 1)
        FromSheet.HPageBreaks.Add Before:=EndPage
    Loop While FromRow <= LastRow

'-------------------------------------------------------------------
    '- print sheet
    With FromSheet.PageSetup
        .CenterHeader = "Iron Mountain Inventory Form"
        .LeftFooter = Date
        .CenterFooter = "Signature _______________________________"
        .RightFooter = "Box Number: " & MyValue
    End With

-------------

I will probably have to take out the MyValue stuff.  It is giving me
the value in column B on the last page, but for every page.  If I can't
figure out how to trick it, I will have to omit it.

It is unfortunate.
Thanks.

0
misscrf1 (8)
10/7/2005 5:51:56 PM
Reply:

Similar Artilces:

Lookup based on criteria in 2 columns
Hi, I am trying to use a vlookup or other function to return the value in the amount column based on the location and date. Here is a sample of my data: Location Date Amount 101 9/15/8 10 101 9/16/8 20 101 9/17/8 15 102 9/15/8 50 102 9/16/8 75 102 9/17/8 67 For example if I wanted to return the amount for location 102 on 9/15/8, what formula would I use? I tried using variations of vlookups but had no luck. Thanks, =SUMPRODUCT(--(A2:A50=102),--(B2:B50=DATE(2008,9,15)),C2:C50) -- Regards, Peo Sjo...

Auto-format in Microsoft Excel.
Each time i try to enter a number range, for example, 8- 10, in Excel, it constantly re-formats it to a date. If I change the formatting to "General" it turns it into a random number, usually 38209. I would like to turn off ALL auto-formatting, but that's probably asking too much. How do I disable this frustrating feature? thanks. Hi Paul When you enter "8-10" in a cell, that's not strictly a number but Excel thinks you mean a date so converts it as such. A date is a number and in your example the number 38209 represents August 10 2004 which is not a ra...

Counting number of X's in a column
I need to sum up the number of "Xs" in a column. I would be extremely grateful if someone could help me with the formula. I cannot seem to get one to work. We are using Excel 2003. Thank you. -- Susie Harris Operations Manager Environmental Education Association of Washington =COUNTIF(A:A,"X") -- HTH RP (remove nothere from the email address if mailing direct) "Susie Harris" <SusieHarris@discussions.microsoft.com> wrote in message news:FFA0FB17-C922-48A8-B3C3-0D487C1E6F6A@microsoft.com... > I need to sum up the number of "Xs" in a col...

Inserting form values into a table
We have a form with values taken from an sql query that comes from two different tables. We would like to enter the information into a third table. Can some one direct me to code that will do the following: 1. Provide the Insert sql that shows us how to add the form values to the table 2. Show us how to loop while inserting the information into the table (there could be several lines on the form, each must be inserted one at a time). I have worked with Access before and have never had a problem inserting information. However, I cannot quite figure out how to insert informtion through an ...

Excel not Access
I have designed an Access database that holds records relating to my stores audit results going back for about 5 years plus a load more information relating to these stores. This was used to produe a pack once a month, however a change in senior management means that I have got to shelve this and prodce a similar pack in Excel. The idea would be that the user could select a month or a 12 mnth date range that would produce data that could then be used to populate a number of excel templates that have been designed. Having not used excel for years I would be grateful for any suggestion...

How to keep format when importing Excel into SQL.
Can anybody help me please? When I import Excel file into SQL, a field that formated as 0000000000 (custom), loosing leading zeros. I tried to change data type in SQL after importing. No luck. I appretiate any help. See if using IMEX=1 helps: http://pratchev.blogspot.com/2007/10/importing-excel-data-into-sql-server.html -- Plamen Ratchev http://www.SQLStudio.com Plamen, I tried this, but got an error: "The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered." Thank you very much for looking into this. "Plamen Ratchev" wr...

Excel 2007
When I select cells to copy as a picture in Excel 2007, the resolution is terrible. Text and objects with shadow's are very blotchy when pasting the picture. How do you change the resolution of a 'Copy Picture'? ...

Input Excel 'Password to Open' through control in access form
Hi All, We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. ...

Copy entire row where CellValue=0
I need to loop through the collumn and search for value that is more then 0. When I find it I need to copy whole row and paste it 2-3 rows below the table. I tried to select the collumn and search the selection but for some reason I copy and paste only one row. Thank you for any help. Hi as a starting point: http://www.rondebruin.nl/copy5.htm -- Regards Frank Kabel Frankfurt, Germany "OxanaB" <OxanaB@discussions.microsoft.com> schrieb im Newsbeitrag news:8628F791-CF2D-480A-9EBF-6C31BCEF0293@microsoft.com... > I need to loop through the collumn and search for value tha...

Looking for XPathReader 1.1
Where is XPathReader 1.1 available for download? I have 1.0 and found the 2005 MS announcement for 1.1 but the link was for godotnet which no longer exists. Nothing shows up in a search at the MS download center or Google. Bill ...

Customized Toolbar RestoreState() fails if it has only 1 button
This issue happens only when the numbers of buttons in the tool bar is "1". Thats is, the user launches the customize toolbar dialog and removes all but 1 tool bar button. I have multiple Tool bars which I persist on application close and restore on application load. The SaveState() works fine as I notice the value "55 81 00 00" saved if only 1 button is left in the Tool bar. Here is the code for the RestoreState for (int i = 0; i < m_ToolBars.GetSize(); i++) { HKEY hSecKey = AfxGetApp()->GetSectionKey("Tool Bars"); if (hSecKey == NULL) break; CS...

How To Copy MS Word mailing labels into Excel
I have a word doc that I want to put into Excel. I want to add some more fields to the names and addresses. Is this simple or do I have to learn how to program? Michael Rodriguez City of Grand Prairie Michael, have you tried to copy and paste the data into excel? -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Michael Rodriguez" <mrodrigu@gptx.org> wrote in messa...

How do I use traffic lights in excel
I am wanting to use traffic lights in excel that change colour based on the result of a variance cell, ie if the result of the cell is 10 make the traffic light green, if it is 20 make the traffic light amber, if the result is 30 make the traffic light red. How do I do this? Shorty Format>Conditional Formatting>Cell Value is: Note: you can add up to 3 conditions(4 if you count default) Gord Dibben Excel MVP On Wed, 22 Dec 2004 16:35:03 -0800, Shorty <Shorty@discussions.microsoft.com> wrote: >I am wanting to use traffic lights in excel that change colour based on the &g...

how do I connect an object from one page to a different page?
I am trying to connect an object from one page to a seperate object on a different page. The instructions say to hold down your mouse button then click on the point you want it connected too. My problem is that is doesn't allow you to select the starting point of the connector, then select a different page, then click on your end point of the connector. Please help! try using a hyperlink. al "Pepper" <Pepper@discussions.microsoft.com> wrote in message news:3F5657F4-48EA-4681-A21E-D33FC7030401@microsoft.com... >I am trying to connect an object from one page to...

Personal Macro Workbook
I had some macro stored in the personal macro workbook but now I can not find the workbook. When I try to do a new macro and store it in the "Personal Macro Workbook" I get the error message "Personal Macro Workbook in the startup folder must stay open for recording". I click ok and get a message that I'm unable to record. I can record macro to other workbooks. What happened to the personal macro workbook ? Thanks ...

Unexpected error message on closing an Excel file
Suddenly I am getting the following message when I try to close a workbook: "Your formula contains an invalid external reference to a worksheet. Verify that the path, workbook, and range name or cell reference are correct, and try again" The mysterious thing is that it does not happen consistently and that, after I click OK after the above message, I can still save the file. What might be the cause of this error message and can the "invalid reference" be tracked down using one of the utility add-ins such as J. Walkenbach's PUP? If it only happens when you close ...

Linker Error after upgrade from VC7.1
Hello all, After upgrading a VC7.1 project to visual studio 2005, it failed to build in the release configuration with the follwoing error : 1>nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined in InstallDlg.obj The debug build works fine. The project uses MFC in a static library. Well, after doing some research, it seems that this one is tied to the fact that in a release configuration, _AFX_ENABLE_INLINES is defined, so inline functions are embedded in the .obj file. Sure there...

help with simple maths in excel
I want to do a simple arithmatic excercise in excel for my grand daughter. It is stuff like 2+2 =4 Smart me has hit a problem at the first hurdle... I need to put 2 in one cell the + in another cell and then 2 in another = in another and then she puts the answer in the next one. So the above would have 4 cells completed and she would put the answer in the 5th one. When I use the + or = sign in a cell of its own it (excel) thinks I am doing an equation, is there a way around this? I will work on the answer like if she gets it correct or wrong how I will do that...a sound or som...

How to change font size on formula bar in Excell 2007
I don't find Tools>Options>General (as suggested in other post answers) in Excel 2007. On the Office button there is an Excel Options but it doesn't provide a method of changing font size on the office but. My font is so small I can barely see it. Office button>ExcelOptions>Popular tab>in the "When creating new workbooks" section, choose font and font size -- Kind regards, Niek Otten Microsoft MVP - Excel "jimwillie" <jimwillie@discussions.microsoft.com> wrote in message news:588AAC05-0F52-404E-AA01-128E70E02D0B@microso...

printing multi page newsletters with publisher 2000
Created a new newsletter in publisher 2000, tried to print it on my Epson Photo R1800 printer which supports up to 13x19 sheet paper and 13"x***' in roll format and could not select a format to print pages 1 and 4 on one side and then 2 and 3 on the other. Downloaded an instruction sheet from Microsoft on printing "two 8.5-by11-inch pages per 11-by-17-inch sheet of paper" It says on "file" click "print", choose a printer that can print on 11x17, then click "Book Printing Option" at the bottom of the dialog box. Problem is this "Bo...

Opening Excel Workbooks
I'm running into an issue where if I click on an Excel file through My Documents, it doesn't automatically bring it up. I get the toolbar but the actual spreadsheet doesn't appear on the screen. I have to click on the taskbar to get it to pop up. If I already have Excel active and I open a file through Excel, this doesn't happen. Any ideas? Here is a similar thread: http://www.excelforum.com/showthread.php?s=&threadid=237195 Rolli -- Message posted from http://www.ExcelForum.com Hi, Take a look at Tools-Options-General tab- uncheck ignore other application...

Excel DNS query
Hello, Is there a way for an Excel function to query a DNS server? Thanks. Soundy Not that I know of, but you can turn on the macro recorder, use 'get external data' and tailor the resulting code into a user function of your own. E.g. I've used this to create a button to get MS-Access data from a query that has the same name as the sheet (tab) name. It saves me a lot of copy-paste actions. Bas Hartkamp <soundy@gmail.com> schreef in bericht news:1151940450.029823.127570@j8g2000cwa.googlegroups.com... > Hello, > > Is there a way for an Excel function ...

outputting values to a range from one formula
I wish to generate a table automatically by means of a single formula that applies an iteration on a starting given value with a given step, and the computed values are posted/entered automtically into cells from a given cell onwards, say below it, until the computed value reaches a certain given limt. This is somehow the inverse of INDIRECT or of OFFSET. These can pull values from a variable addresses of cells. What I need is to push values into a variable addresses of cells. Can anyone help me on that?? Thanks. :confused -- Shafe ---------------------------------------------------------...

How do I merge cells with multiple data values?
I've tried highlighting the two cells which are in the same row. It suggested that I format and align. Both of which I've tried. I keep getting the same error message, "The selection contains multiple data values. Merging into one cell will keep the upper-most data only." I need to make the cells one with all my information. Is this possible? Not knowing what you want to do, let me make a suggestion. Put all your data into the first cell and leave the second cell empty. Select both cells. Click on Format - Cells - Alignment tab. In the "Horizontal" b...

[b]Can I download Excel data to a MS Access database?[/b]
I've built an Excel 2002 form that I want our internal customers to access from our intranet, and use. Once completed, they will send it to us as an e-mail attachment. I'd like to be able to open it, and somehow download the data from the form into an MS Access 2002 database I've built (so that we don't have to rekey it into the database). Is this possible or even feasible? Any and all help is appreciated. Thanks. :D --------- Message sent via www.excelforums.com Hi in Access check 'File - Import External data' -- Regards Frank Kabel Frankfurt, Germany "...