Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I select the first blank cell Valdemar[_2_] Excel Worksheet Functions 4 January 18th 10 12:04 PM
Select until blank row Bonnie Excel Discussion (Misc queries) 8 July 21st 08 08:41 PM
Select NON blank cells pcor New Users to Excel 8 September 18th 06 10:55 AM
select first non blank cell JH Excel Programming 1 July 12th 05 03:38 PM
Select blank cell Hodar Excel Programming 6 January 21st 04 02:18 PM


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"