Hi All,
Please help me to give a macro code for below mentioned file.
Enter Start & End Date using userform or inputbox and find the date range, then copy entire row in sheet 1 and paste the data's in sheet 2 end of last blank row.
Dout.xlsx
Hi All,
Please help me to give a macro code for below mentioned file.
Enter Start & End Date using userform or inputbox and find the date range, then copy entire row in sheet 1 and paste the data's in sheet 2 end of last blank row.
Dout.xlsx
I am not sure I understand your question. You want to take input from a user in a form into sheet1 and then copy it to sheet2 ?
Can you not directly copy the data to sheet2 directly?
PHP Code:
Option Explicit
Sub MsgBoxDate()
Dim fDat As Date, lDat As Date, NDat As Integer, jJ As Integer
Dim sfDat As String, slDat As String, Format_ As String, MyAdd As String
Dim Rng As Range, sRng As Range
sfDat = InputBox("ENTER FIRST DATE", , Date - 9)
fDat = CVDate(sfDat)
slDat = InputBox("ENTER LAST DATE", , Date)
lDat = CVDate(slDat)
Sheet1.Select: NDat = lDat - fDat
Set Rng = Range([A2], [A2].End(xlDown))
Format_ = Rng.NumberFormat
Rng.NumberFormat = "MM/dd/yyyy"
For jJ = 0 To NDat
Set sRng = Rng.Find(Format(fDat + jJ, "mm/dd/yyyy"), , xlValues, xlWhole)
If Not sRng Is Nothing Then
MyAdd = sRng.Address
Do
With Sheet2.[A65500].End(xlUp).Offset(1)
.Resize(, 3).Value = sRng.Resize(, 3).Value
End With
Set sRng = Rng.FindNext(sRng)
Loop While Not sRng Is Nothing And sRng.Address <> MyAdd
End If
Next jJ
Rng.NumberFormat = Format_
End Sub
Hi nimbus3000
sheet 1 is the master sheet. i want copy data's where i given the start & end date through userform or inputbox. That Copied date range rows should be past in sheet 2.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks