Forum Discussion
Chalz2709
Feb 20, 2020Copper Contributor
VBA code to start auto fill in column A until multiple or single data available in column B.
Dear Reader, I work on some handful of excels everyday. For some files I need to fill Column A until multiple or single data available in Column B(usually from B2 the datas will be available as B...
Chalz2709
Feb 21, 2020Copper Contributor
Hello Sir,
I want to update on multiple excels. Yes Column A is to be auto filled with A2 Data until the datas in column b is available.
File vairies everyday. sometimes multiple number of rows would be filled. Sometimes single and later sometimes empty sheets.
I want to update on multiple excels. Yes Column A is to be auto filled with A2 Data until the datas in column b is available.
File vairies everyday. sometimes multiple number of rows would be filled. Sometimes single and later sometimes empty sheets.
Subodh_Tiwari_sktneer
Feb 21, 2020Silver Contributor
The following code will loop through all the worksheets of the open workbooks and fill the column A with what is there in cell A2 on those sheets.
Sub FillColumnA()
Dim wb As Workbook
Dim ws As Worksheet
Dim lr As Long
Application.ScreenUpdating = False
For Each wb In Application.Workbooks
For Each ws In wb.Worksheets
lr = ws.Cells(Rows.Count, "B").End(xlUp).Row
ws.Range("A2:A" & lr).Value = ws.Range("A2").Value
Next ws
Next wb
Application.ScreenUpdating = True
End Sub