Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

how to fill an empty cell

已查看 2 次
跳至第一个未读帖子

bolenang

未读,
2001年9月21日 11:52:562001/9/21
收件人
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

未读,
2001年9月21日 00:13:142001/9/21
收件人
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

未读,
2001年9月21日 00:13:272001/9/21
收件人
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

未读,
2001年9月21日 00:32:542001/9/21
收件人
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

未读,
2001年9月21日 18:24:312001/9/21
收件人
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

未读,
2001年9月21日 18:25:062001/9/21
收件人
fat fingers!

something like this:

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

--

Dave Peterson
ec3...@msn.com

0 个新帖子