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...
Subodh_Tiwari_sktneer
Feb 20, 2020Silver Contributor
Are you saying that one or multiple excel files are opened and you want to fill column A based on what is filled in column B?
What is to be filled in column A?
Isn't it better if you upload a sample file to show us what exactly you are trying to achieve by mocking up the desired output manually in column A?
- Chalz2709Feb 21, 2020Copper ContributorHello 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.- Subodh_Tiwari_sktneerFeb 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