Forum Discussion
A_SIRAT
Apr 13, 2023Iron Contributor
help with a vba macro
Hi,
I have attached a sample file with explanations. I need to be copying data everyday to the records sheet and a macro button would ease the work.
Try this:
Sub ProcessDailyRequistion() Dim m As Long Dim s As Range Dim t As Range With Sheets("Data Entry") m = .Range("B15").End(xlUp).Row Set s = .Range("A2:E" & m) End With With Sheets("Records") Set t = .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(m - 1, 5) End With t.Value = s.Value End Sub
Try this:
Sub ProcessDailyRequistion() Dim m As Long Dim s As Range Dim t As Range With Sheets("Data Entry") m = .Range("B15").End(xlUp).Row Set s = .Range("A2:E" & m) End With With Sheets("Records") Set t = .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(m - 1, 5) End With t.Value = s.Value End Sub
- A_SIRATIron Contributorthank you !