Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do you set the commands that if the activecell is null
or blank, it carries out certain commands? This is the syntax I have right now, but the null command doesn't seem to be working correctlly. Please help, thank you. If ActiveCell Is Null Then Selection.AutoFill Destination:=Range(Cells("33", ActiveCell.Column - 1), Cells("33", ActiveCell.Column)), Type:=xlFillDefault Range("B30").End(xlToRight).Select ActiveCell.Offset(rowOffset:=6, columnOffset:=-1).Select Range(Cells("36", ActiveCell.Column - 1), Cells("40", ActiveCell.Column - 1)).Select Selection.AutoFill Destination:=(Range(Cells("36", ActiveCell.Column - 1), Cells("40", ActiveCell.Column)).Select), Type:=xlFillDefault End If |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could try the Is Nothing Statement
or try Search = cell.Find(What="") If Search Is Nothing then else end if... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if isempty(activecell) then
Regards, Tom Ogilvy "Sok Hong" wrote in message ... How do you set the commands that if the activecell is null or blank, it carries out certain commands? This is the syntax I have right now, but the null command doesn't seem to be working correctlly. Please help, thank you. If ActiveCell Is Null Then Selection.AutoFill Destination:=Range(Cells("33", ActiveCell.Column - 1), Cells("33", ActiveCell.Column)), Type:=xlFillDefault Range("B30").End(xlToRight).Select ActiveCell.Offset(rowOffset:=6, columnOffset:=-1).Select Range(Cells("36", ActiveCell.Column - 1), Cells("40", ActiveCell.Column - 1)).Select Selection.AutoFill Destination:=(Range(Cells("36", ActiveCell.Column - 1), Cells("40", ActiveCell.Column)).Select), Type:=xlFillDefault End If |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is Null refers to object variables. ActiveCell Is Null would be true only if there were no
active cell (is that possible?). You want to know something about the CONTENTS of the active cell -- is it empty. You can learn that with If ActiveCell.Value = "" Then Note that I use the Value property of the cell, which happens to be the default property. On Thu, 7 Aug 2003 06:37:32 -0700, "Sok Hong" wrote: How do you set the commands that if the activecell is null or blank, it carries out certain commands? This is the syntax I have right now, but the null command doesn't seem to be working correctlly. Please help, thank you. If ActiveCell Is Null Then Selection.AutoFill Destination:=Range(Cells("33", ActiveCell.Column - 1), Cells("33", ActiveCell.Column)), Type:=xlFillDefault Range("B30").End(xlToRight).Select ActiveCell.Offset(rowOffset:=6, columnOffset:=-1).Select Range(Cells("36", ActiveCell.Column - 1), Cells("40", ActiveCell.Column - 1)).Select Selection.AutoFill Destination:=(Range(Cells("36", ActiveCell.Column - 1), Cells("40", ActiveCell.Column)).Select), Type:=xlFillDefault End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
If statement that outputs specific text if cell is not null | Excel Discussion (Misc queries) | |||
COUNTIF says Null = Blank but Blank < Null | Excel Worksheet Functions | |||
if a1 = null then a1 = b1...how do I do this? | Excel Discussion (Misc queries) | |||
cell value based on null/not null in another cell | Excel Worksheet Functions |