already
Board Regular
- Joined
- Nov 11, 2008
- Messages
- 179
Hi
I'm using following code to copy rows to another sheet based on the value in column F. I can't combine the code to copy the different values to different sheets (ex all rows with value 'test1' go to sheet2 all with 'test2" go to sheet 3)without having empty rows. When I run different macros to do this I don't have any problem. The goal is to sort 1 sheet to 3 sheets (3 different values in column F)
Any help is welcome.
Thanks
Al
part of the code
If Range("F" & CStr(LSearchRow)).Value = "test" Then<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select<o></o>
Selection.Copy<o></o>
<o></o>
Sheets("Sheet2").Select<o></o>
Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select<o></o>
ActiveSheet.Paste<o></o>
<o></o>
'Move counter to next row<o></o>
LCopyToRow = LCopyToRow + 1<o></o>
<o></o>
Sheets("Sheet1").Select<o></o>
<o></o>
End If<o></o>
I'm using following code to copy rows to another sheet based on the value in column F. I can't combine the code to copy the different values to different sheets (ex all rows with value 'test1' go to sheet2 all with 'test2" go to sheet 3)without having empty rows. When I run different macros to do this I don't have any problem. The goal is to sort 1 sheet to 3 sheets (3 different values in column F)
Any help is welcome.
Thanks
Al
part of the code
If Range("F" & CStr(LSearchRow)).Value = "test" Then<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select<o></o>
Selection.Copy<o></o>
<o></o>
Sheets("Sheet2").Select<o></o>
Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select<o></o>
ActiveSheet.Paste<o></o>
<o></o>
'Move counter to next row<o></o>
LCopyToRow = LCopyToRow + 1<o></o>
<o></o>
Sheets("Sheet1").Select<o></o>
<o></o>
End If<o></o>