Macro Help - Simple Copy and Paste Until Null Cell Reached

The Ruff Report

New Member
Joined
Jun 17, 2023
Messages
21
Office Version
  1. 365
Platform
  1. Windows
I have gone through some other loop posts but haven't quite found what I'm looking for. In the macro below, X can be anywhere from 50 stores to 250 stores. Instead of updating X, I'd like the most basic way for the macro to run until it reaches the first blank cell in column A of the Master, then ideally, a message box that all reports have been created. Thanks in advance.

Picture4.png




Sub UntilCellEmptyMacro()

' Copy data in column A and paste into column B until Column A is null

Dim X As Integer
X = 1
Do Until X = 222
Workbooks("Master.xlsm").Sheets("Vendor List").Range("A" & X).Copy Destination:=Workbooks("Template.xlsx").Sheets("Vendor").Range("A1")

' Do various calculations in the Template workbook and save as Store Name

X = X + 1

Application.CutCopyMode = False

Loop

End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,224,763
Messages
6,180,823
Members
452,997
Latest member
gimamabe71

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