Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to select first blank row?
I have a macro copies all the rows from sheets that are not named "IB_Status"
to the "IB_Status" sheet. The macro worked great when all I had to do was insert the rows (I could select row 2 and shift any existing rows down). Now it turns out that I need to copy and paste the values (since I don't want to copy the formulas). I need to figure out how to select the first blank row in "IB_Status": Dim wks As Object For Each wks In Worksheets On Error Resume Next wks.Activate If wks.Name < "IB_Status" Then wks.Select Range("A2:G2").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("IB_Status"). Select ' I need to paste values rather than insert ' Need code to select the first blank row here ' Rows("2:2").Select --Old code ' Selection.Insert Shift:=xlDown -Old code Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If Next wks I would appreciate any help you can give me. Thank you, Judy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to select first blank row?
untested but this should work...
Dim wks As worksheet For Each wks In Worksheets On Error Resume Next wks.Activate If wks.Name < "IB_Status" Then wks.Select Range("A2:G2").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("IB_Status"). Select Sheets("IB_Status").cells(rows.count, 1).end(xlup).offset(1,0).select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If Next wks -- HTH... Jim Thomlinson "Judy Ward" wrote: I have a macro copies all the rows from sheets that are not named "IB_Status" to the "IB_Status" sheet. The macro worked great when all I had to do was insert the rows (I could select row 2 and shift any existing rows down). Now it turns out that I need to copy and paste the values (since I don't want to copy the formulas). I need to figure out how to select the first blank row in "IB_Status": Dim wks As Object For Each wks In Worksheets On Error Resume Next wks.Activate If wks.Name < "IB_Status" Then wks.Select Range("A2:G2").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("IB_Status"). Select ' I need to paste values rather than insert ' Need code to select the first blank row here ' Rows("2:2").Select --Old code ' Selection.Insert Shift:=xlDown -Old code Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If Next wks I would appreciate any help you can give me. Thank you, Judy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to select first blank row?
This does work. Thank you very much.
"Jim Thomlinson" wrote: untested but this should work... Dim wks As worksheet For Each wks In Worksheets On Error Resume Next wks.Activate If wks.Name < "IB_Status" Then wks.Select Range("A2:G2").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("IB_Status"). Select Sheets("IB_Status").cells(rows.count, 1).end(xlup).offset(1,0).select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If Next wks -- HTH... Jim Thomlinson "Judy Ward" wrote: I have a macro copies all the rows from sheets that are not named "IB_Status" to the "IB_Status" sheet. The macro worked great when all I had to do was insert the rows (I could select row 2 and shift any existing rows down). Now it turns out that I need to copy and paste the values (since I don't want to copy the formulas). I need to figure out how to select the first blank row in "IB_Status": Dim wks As Object For Each wks In Worksheets On Error Resume Next wks.Activate If wks.Name < "IB_Status" Then wks.Select Range("A2:G2").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.Copy Sheets("IB_Status"). Select ' I need to paste values rather than insert ' Need code to select the first blank row here ' Rows("2:2").Select --Old code ' Selection.Insert Shift:=xlDown -Old code Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If Next wks I would appreciate any help you can give me. Thank you, Judy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I select the first blank cell | Excel Worksheet Functions | |||
Select until blank row | Excel Discussion (Misc queries) | |||
Select NON blank cells | New Users to Excel | |||
select first non blank cell | Excel Programming | |||
Select blank cell | Excel Programming |