end it

S

stacia

It gives me an error on end if


Sub b9shop()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Worksheets("Payroll").Activate
ActiveSheet.UsedRange.Select
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") > 0 Then
Worksheets("payroll").Active
With ActiveCell.Cells(x + 2, 1)
FormulaR1C1 = _
"=VLOOKUP(Data!R[-5]C:R[410]C[6],Address!R2C1:R21C4,2)"
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

R1C1 1
R1C1 0
HELP Copy And Paste 7
automatic page break 1
Paste Special throwing an error 0
Need Excel Macro to Find Specific Text and Characters 1
VBA Coding Help for Beginner 0
Creating a fixture list 3

Top