T
tcnolan
Hi,
I have code that is looping thru data in one worksheet and copying
certain rows to another workbook. It works fine but is very slow. I
think it is how I am selecting the sheets to copy/paste the data. (I
do have screenupdating off, etc.).
If someone could look and let me know how to simplify this code, I
would appreciate it. I know I am not writing it the most efficient way
but can't seem to get the syntax correct. This is the code in between
the For Each cell...Next routine:
*************************************
If cell = strLookup Then
currentbook.Sheets("Sheet1").Activate
Sheets("Sheet1").Range("A" & cell.row, "B" & cell.row).Copy
new_wkbk.Sheets("NewSheet").Activate
Sheets("NewSheet").Range("a" & cellnum).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
End If
*************************************
Thank you,
Terry
I have code that is looping thru data in one worksheet and copying
certain rows to another workbook. It works fine but is very slow. I
think it is how I am selecting the sheets to copy/paste the data. (I
do have screenupdating off, etc.).
If someone could look and let me know how to simplify this code, I
would appreciate it. I know I am not writing it the most efficient way
but can't seem to get the syntax correct. This is the code in between
the For Each cell...Next routine:
*************************************
If cell = strLookup Then
currentbook.Sheets("Sheet1").Activate
Sheets("Sheet1").Range("A" & cell.row, "B" & cell.row).Copy
new_wkbk.Sheets("NewSheet").Activate
Sheets("NewSheet").Range("a" & cellnum).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
End If
*************************************
Thank you,
Terry