AutoFill Help

gtbb

Board Regular
Joined
Apr 7, 2008
Messages
118
Workbooks.Open Filename:= _
"T:\TEST\Error Log Report\External report.xlsx"
Range("A2:H2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Bank Perfomance Metric.xlsm").Activate
Sheets("Bank Error").Select
lMaxRows = Cells(Rows.Count, "a").End(xlUp).Row
Range("a" & lMaxRows + 1).Select
ActiveSheet.Paste
lMaxRows = Cells(Rows.Count, "I").End(xlUp).Row
Range("I" & lMaxRows + 1).Select
ActiveCell.FormulaR1C1 = "2"
ActiveCell.Copy
??????????

Hi Eveyone,

I am looking for some help with my above macro. I am trying to fill out the missing steps that will autofill "2" down to the last cell in column I that corresponds to the data in columns A-G. Your help is very much appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
One way:
Code:
    Dim wks As Worksheet
    Dim r As Range
    
    Set wks = Workbooks("Bank Perfomance Metric.xlsm").Worksheets("Bank Error")
    Set r = wks.Cells(Rows.Count, "A").End(xlUp).Offset(1)
    
    Workbooks.Open Filename:="T:\TEST\Error Log Report\External report.xlsx"
    With Range("A2", Range("H2").End(xlDown))
        .Copy r
        wks.Cells(r.Row, "I").Resize(.Rows.Count).Value = 2
    End With
 
Upvote 0
Hi Shg,

It works perfectly. I truly appreciate your help. I was worry if anyone would understand my question. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top