Dear Friends,
I have the following codes to copy specific data from one sheet to
another
Private Sub CommandButton1_Click()
Dim x As Long
Dim y As Long
y = 1
For x = 1 To 65536
If Cells(x, 1).Value =1245 And Cells(x, 1).Value <= 2000 Then
Cells(x, 1).EntireRow.Copy
Sheets("sheet2").Cells(y, 1).PasteSpecial
y = y + 1
End If
Next x
Application.CutCopyMode = False
End Sub
1. Col A of active sheet has numeric values which are copied from
1245 to 2000 in Sheet2. If Col A contains Date values then above codes
does not work. How can I overcome the problem ?
2. If I create a temp worksheet through userform and then copy from
one sheet to tempws then these codes does not work.
The code for creating temp worksheet are as
Private sub userform_activate()
Dim tempws as worksheet
Set tempws = Thisworkbook.worksheets.add
Tempws.name = “Temp”
End sub
How I can overcome the above two problems
Thanks
Syed Haider Ali
--
Syed Haider Ali
------------------------------------------------------------------------
Syed Haider Ali's Profile:
http://www.excelforum.com/member.php...o&userid=21994
View this thread:
http://www.excelforum.com/showthread...hreadid=515923