Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet, Range from C3:AM100 some have number, some is blank.
How can I create a function, if is blank in C2:Am100, then is 0, if is not blank, stay whatever number is. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() =IF(C3="",0,C3) "hong" wrote in message ... I have a spreadsheet, Range from C3:AM100 some have number, some is blank. How can I create a function, if is blank in C2:Am100, then is 0, if is not blank, stay whatever number is. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this...
Sub ChangeToZero() Dim rng As Range On Error Resume Next Set rng = Range("C3:AM100").SpecialCells(xlCellTypeBlanks) On Error GoTo 0 If Not rng Is Nothing Then rng.Value = 0 End Sub -- HTH... Jim Thomlinson "hong" wrote: I have a spreadsheet, Range from C3:AM100 some have number, some is blank. How can I create a function, if is blank in C2:Am100, then is 0, if is not blank, stay whatever number is. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
eg:
Private Sub CommandButton1_Click() Range("C2", "Am100").Select For Each cell In Selection If cell.Value = "" Then cell.Value = "0" Next End Sub hong wrote: I have a spreadsheet, Range from C3:AM100 some have number, some is blank. How can I create a function, if is blank in C2:Am100, then is 0, if is not blank, stay whatever number is. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
Need to open the Function Arguments window from VBA for a user defined function. | Excel Programming | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions |