Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Replaceblanks()
Dim rng as Range, rng1 as Range set rng = Range(cells(1,1),cells(rows.count,2).End(xlup).off set(0,-1)) set rng1 = rng.specialcells(xlBlanks) rng1.formulaR1C1 = "=R[-1]C" rng.Formula = rng.Value End sub -- Regards, Tom Ogilvy "Christy" wrote: I am pulling a standard report from SAP. I have inserted lines, which left blank cells in column A. Column A is primary key for my pivot table. Therefore, i need macro that will recognize any blank cells in column A then autofill them using the first filled out cell above the blank cell. I tried For each cell in range ("a:a") If cell.value="" then cell.offset(-1,0).copy cell.offset(1,0).paste end if next cell but this did not work. any suggestions? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I can't autofill cells in a column if blank cells in between | Excel Worksheet Functions | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
Use Autofill in a macro to fill blank cells until next text - | Excel Programming | |||
Autofill data in specific blank cells | Excel Worksheet Functions | |||
Use Autofill in a macro to fill blank cells until next text - | Excel Programming |