Avatar of Euro5
Euro5Flag for United States of America

asked on 

VBA to copy down text in a column

I have to copy down text in a column, but there is a catch!
I can't just copy down until there is text in cell because that won't work with the very last item in the column. I need to copy Column B until there is a non-blank cell in column A!

After those are done, I can copy down text until the next non-empty cell in column A.

Can anyone help me with the VBA for this!?
I uploaded a sample file - THANK YOU!! :)

VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Rob Henson
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Is Sheet1 the result that you want?
Avatar of Euro5
Flag of United States of America image


Hi, Martin!
I put both the start and the end on sheet 1.
It will originally look like the data in columns A & B
But should end up like the columns to the right.
Thanks so much!
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

lad I could help and thanks for the Testimonial.
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Could also do with 2 simple formulas.

In spare columns, eg K and L enter these formulas:
K2 =IF(A2="",K1,A2)
L2 =IF(B2="",L1,B2)

Copy down as far as required and then copy and paste values into the original range.
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo