Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RJH RJH is offline
external usenet poster
 
Posts: 44
Default Copy to a specific row

I'm using this code to copy information from sheet one to my vendor sheet.

Private Sub CommandButton1_Click()
Sheets("ERW").Range("A3:X50000").ClearContents
For Each c In Worksheets("Sheet1").Range("F:F")
If (c) = "ERW" Then
x = Sheets("ERW").Cells(Rows.Count, "a") _
..End(xlUp).Offset(1, 1).Row
c.EntireRow.Copy Sheets("ERW").Cells(x, "a")
End If
Next
End Sub

currently it copies into 'A2' (I have labels in 'A1'). How do I make it
copy starting at 'A3' instead?

Thanks!

RJH


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy to a specific row

Private Sub CommandButton1_Click()
Sheets("ERW").Range("A3:X50000").ClearContents
For Each c In Worksheets("Sheet1").Range("F:F")
If (c) = "ERW" Then
x = Sheets("ERW").Cells(Rows.Count, "a") _
..End(xlUp).Offset(1, 1).Row
if x < 3 then x = 3
c.EntireRow.Copy Sheets("ERW").Cells(x, "a")
End If
Next
End Sub

--
Regards,
Tom Ogilvy


RJH wrote in message
...
I'm using this code to copy information from sheet one to my vendor sheet.

Private Sub CommandButton1_Click()
Sheets("ERW").Range("A3:X50000").ClearContents
For Each c In Worksheets("Sheet1").Range("F:F")
If (c) = "ERW" Then
x = Sheets("ERW").Cells(Rows.Count, "a") _
.End(xlUp).Offset(1, 1).Row
c.EntireRow.Copy Sheets("ERW").Cells(x, "a")
End If
Next
End Sub

currently it copies into 'A2' (I have labels in 'A1'). How do I make it
copy starting at 'A3' instead?

Thanks!

RJH




  #4   Report Post  
Posted to microsoft.public.excel.programming
RJH RJH is offline
external usenet poster
 
Posts: 44
Default Copy to a specific row

Thanks Tom, it worked perfectly!

RJH


"Tom Ogilvy" wrote in message
...
Private Sub CommandButton1_Click()
Sheets("ERW").Range("A3:X50000").ClearContents
For Each c In Worksheets("Sheet1").Range("F:F")
If (c) = "ERW" Then
x = Sheets("ERW").Cells(Rows.Count, "a") _
.End(xlUp).Offset(1, 1).Row
if x < 3 then x = 3
c.EntireRow.Copy Sheets("ERW").Cells(x, "a")
End If
Next
End Sub

--
Regards,
Tom Ogilvy


RJH wrote in message
...
I'm using this code to copy information from sheet one to my vendor

sheet.

Private Sub CommandButton1_Click()
Sheets("ERW").Range("A3:X50000").ClearContents
For Each c In Worksheets("Sheet1").Range("F:F")
If (c) = "ERW" Then
x = Sheets("ERW").Cells(Rows.Count, "a") _
.End(xlUp).Offset(1, 1).Row
c.EntireRow.Copy Sheets("ERW").Cells(x, "a")
End If
Next
End Sub

currently it copies into 'A2' (I have labels in 'A1'). How do I make it
copy starting at 'A3' instead?

Thanks!

RJH






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
Copy data to a specific row smith82 New Users to Excel 0 February 15th 11 04:12 PM
Copy, Paste in a specific format DB Excel Discussion (Misc queries) 0 May 2nd 07 07:47 PM
copy row with specific name to row 52 [email protected] Excel Worksheet Functions 0 February 13th 07 02:16 PM
COPY AND PASTE SPECIFIC ROWS HERNAN Excel Discussion (Misc queries) 2 August 17th 06 07:32 PM
copy/print specific data Anthony Excel Worksheet Functions 3 January 26th 05 10:47 PM


All times are GMT +1. The time now is 01:45 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"