SOLVED

help with a vba macro

Iron Contributor

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.

2 Replies
best response confirmed by A_SIRAT (Iron Contributor)
Solution

@A_SIRAT 

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
thank you !
1 best response

Accepted Solutions
best response confirmed by A_SIRAT (Iron Contributor)
Solution

@A_SIRAT 

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

View solution in original post