Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to fill an empty cell

2 views
Skip to first unread message

bolenang

unread,
Sep 21, 2001, 11:52:56 AM9/21/01
to
I have a big spreadsheets here and in some coloumn there is empty cells
what I want to do is to fill those empty cells with 0 (zero)
anyone can help me please....

TIA

Patrick Molloy

unread,
Sep 21, 2001, 12:13:14 AM9/21/01
to
Sub FillZeros()
dim rng as range
For each rng in activesheet.usedrange
IF RNG="" THEN rng=0
next
End sub

its isn't pretty, but it'll do. copy the code to a standard module & run it.
If you don't know how, email me & I'll send it to you.

--
Patrick Molloy
Microsoft Excel MVP


"bolenang" <rd_e...@yahoo.com> wrote in message
news:1103_1001087576@KP081...

David McRitchie

unread,
Sep 21, 2001, 12:13:27 AM9/21/01
to
A non-programming method:

place a zero in an empty cell and copy it (Ctrl+c)
Select a range that includes the empty cells that are to receive zeros.
Ctrl+G (edit, goto), Special, blank cells
Edit, paste special, values

If you record a macro you would get something along the lines of:

Sub Macro1()
Range("H3").Select
Selection.Copy
Range("F1:F22").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub

HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Macros: http://www.geocities.com/davemcritchie/excel/excel.htm
Search Page: http://www.geocities.com/davemcritchie/excel/search.htm

"bolenang" <rd_e...@yahoo.com> wrote in message news:1103_1001087576@KP081...

Tim Zych

unread,
Sep 21, 2001, 12:32:54 AM9/21/01
to
This will fill zeroes in blank cells in the Used Range:

On Error Resume Next
ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Value = 0


"bolenang" <rd_e...@yahoo.com> wrote in message
news:1103_1001087576@KP081...

Dave Peterson

unread,
Sep 21, 2001, 6:24:31 PM9/21/01
to
One more option:

Select your range and do an Edit|Replace (nothing) with 0. Make sure Find
Entire cells only is checked.

in VBA, something like:

--

Dave Peterson
ec3...@msn.com

Dave Peterson

unread,
Sep 21, 2001, 6:25:06 PM9/21/01
to
fat fingers!

something like this:

Range("B1:B31").Replace What:="", Replacement:="0", _
LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False

--

Dave Peterson
ec3...@msn.com

0 new messages