View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
r r is offline
external usenet poster
 
Posts: 125
Default Want to check if cell is blank before running macro


Sub test()
If IsEmpty([d4]) Then _
Err.Raise 1000, , "Your error"

End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Munchkin" wrote:

I'm only entering part of my macro button because it's long.

The first thing I want my macro to do is look at D4 & give an error message
if the cell is blank. How do I do that?



Sheets("REQUEST ").Select
ActiveSheet.Unprotect
Rows("4:4").Select
Selection.Insert Shift:=xlDown
Application.Goto Reference:="NewRecord"
Selection.Copy
Rows("4:4").Select
ActiveSheet.Paste
Range("A4").Select
Application.CutCopyMode = False
Selection.Copy
Range("D4").Select
Sheets("SEARCH ").Select
Range("D9:E9").Select
Application.CutCopyMode = False