View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Norbert[_4_] Norbert[_4_] is offline
external usenet poster
 
Posts: 52
Default macro to run in event of cell value <""

On Tuesday, August 28, 2012 2:13:26 PM UTC+2, Claus Busch wrote:
Hi Norbert,



Am Tue, 28 Aug 2012 04:32:56 -0700 (PDT) schrieb Norbert:



cell V3 has following formula:


=IF(ISERROR('common warps'!B4)=TRUE,"",'common warps'!B4)




In case B4 shows an error like N/A, V3 does not show anything, but in case


B4 shows a value e.g.: H12 (In this case H12 is not a cell, it is a value).




Is there a possibility to run a certain macro in the event of cell V3 showing a value?




try in code module of the sheet:



Private Sub Worksheet_Calculate()

If Len([V3]) 0 Then

your code

End If

End Sub





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


Hi Claus,
please check my code. I get a run time error '1004':
Select method of Range class failed
When I debug, it leads me to row 4: Range("A6").Select


Private Sub Worksheet_Calculate()
If Len([V3]) 0 Then
Sheets("warp info").Select
Range("A6").Select
Selection.EntireRow.Insert
Rows("7:7").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A2:I2").Select
Selection.Copy
Range("A6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A6").Select
Application.CutCopyMode = False
Sheets("Planning tickets").Select
End If
End Sub