Thread: DTPicker
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Syed Haider Ali[_37_] Syed Haider Ali[_37_] is offline
external usenet poster
 
Posts: 1
Default DTPicker


Dear freinds,

hi

I have DTPicker1 and DTPicker2 on my userform through these i copy data
from Sheet1 for a specific period to paste data sheet2. The following
codes i am using

Private Sub CommandButton1_Click()

Worksheets("sheet1").Select
Dim x As Long
Dim y As Long
y = 1
For x = 1 To 65536
If Cells(x, 1).Value = CDate(DTPicker1) And Cells(x, 1).Value <=
CDate(DTPicker2) Then
Sheets("sheet2").Cells(y, 1).Value = Cells(x, 1).Value
Sheets("sheet2").Cells(y, 2).Value = Cells(x, 2).Value
Sheets("sheet2").Cells(y, 3).Value = Cells(x, 3).Value
y = y + 1
End If
Next x
End Sub

I am copying data only from one sheet1 through DTPickers to paste into
Sheet2. My question is if i have two sheets i.e sheet1 and sheet2
having date field at col A in each sheet . What would be the code to
copy data from sheet1 and sheet2 to paste into sheet3 using same
DTPicker1 and DTPicker2.

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=560430