Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy to a specific row
I usually use
x = Sheets("ERW").Cells(Rows.Count, "a") .End(xlUp).Row+1 -- Don Guillett SalesAid Software "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy data to a specific row | New Users to Excel | |||
Copy, Paste in a specific format | Excel Discussion (Misc queries) | |||
copy row with specific name to row 52 | Excel Worksheet Functions | |||
COPY AND PASTE SPECIFIC ROWS | Excel Discussion (Misc queries) | |||
copy/print specific data | Excel Worksheet Functions |