Autofill Macro

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have a large amount of data that requires me to
autofill all the blanks in order to run a p;ivot report.
Is there a macro or other means that will allow me to
have the autofill function fill every blank cell below a
value, until it reaches a new value then switch to that
value for every blank cell below and etc.

Thanks
 
Chris

Dave has pointed you to a non-programming solution. If you want a macro try
this.....

''fill in blanks from cell above
Sub Fill_Blanks()
Dim myRange As Range
Set myRange = Selection
On Error GoTo stopnow
If myRange.Cells.Count = 1 Then
MsgBox "Select a range first."
Else
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
Range("B1").Select
End If
stopnow:
End Sub

Gord Dibben Excel MVP - XL97 SR2 & XL2002
 
Dave? Who's Dave?

Gord said:
Chris

Dave has pointed you to a non-programming solution. If you want a macro try
this.....

''fill in blanks from cell above
Sub Fill_Blanks()
Dim myRange As Range
Set myRange = Selection
On Error GoTo stopnow
If myRange.Cells.Count = 1 Then
MsgBox "Select a range first."
Else
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
Range("B1").Select
End If
stopnow:
End Sub

Gord Dibben Excel MVP - XL97 SR2 & XL2002

I have a large amount of data that requires me to
autofill all the blanks in order to run a p;ivot report.
Is there a macro or other means that will allow me to
have the autofill function fill every blank cell below a
value, until it reaches a new value then switch to that
value for every blank cell below and etc.

Thanks
 
Hi Dog!

Re:
Got 3 of the letters correct.

No I don't think so!

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
Holidays and Observances Friday 18th July: Mexico (Day of Mourning
death of Benito Juarez), Spain (Labor Day), Uruguay (Constitution Day)
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top