Autofill Macro

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
 
G

Gord Dibben

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
 
D

Debra Dalgleish

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
 
N

Norman Harker

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Macro Loop 0
AutoFill 1
Autofill: can it detect change in value? 3
AutoFill Macro Issue 1
HELP!!! I need macro to autofill 4
Dynamic Autofill 4
Macro 0
VBA Coding Help for Beginner 0

Top