ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy a value in a column over blank cells (https://www.excelbanter.com/excel-programming/360945-copy-value-column-over-blank-cells.html)

mohd21uk via OfficeKB.com

Copy a value in a column over blank cells
 
I would like to copy values in Column A over blank cells until the next
available value. I would like this to run in a loop until a blank row is
reached. I would be grateful if you could provide me a macro that can do this.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1

Bernie Deitrick

Copy a value in a column over blank cells
 
Don't loop:

Sub FillColumnA()
On Error GoTo NoBlanks
With Columns("A:A")
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
NoBlanks:
End Sub

HTH,
Bernie
MS Excel MVP


"mohd21uk via OfficeKB.com" <u20517@uwe wrote in message news:5ffe29df54ebe@uwe...
I would like to copy values in Column A over blank cells until the next
available value. I would like this to run in a loop until a blank row is
reached. I would be grateful if you could provide me a macro that can do this.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1





All times are GMT +1. The time now is 03:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com