Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Size bug with DTPicker | Excel Programming | |||
can you use the dtpicker in an userfrom | Excel Worksheet Functions | |||
dtpicker problem | Excel Discussion (Misc queries) | |||
REPOST: Looking for how to use DTPicker | Excel Programming | |||
DTpicker problem | Excel Programming |