Search : in
By :

If Statement in Macro

Last answer on May 29, 2009 9:42:17 am BST Rilliams, on May 28, 2009 2:49:31 pm BST 
 Report this message to moderators

Hello,
Im trying to write a macro. Im using a simple if Statment for a command button and it is as follows:

if J1 = 11 Then
<MACRO>
<MACRO>
Endif

I step through it in the debugger and it says that J1 is always Empty.

Im missing some thing simple but do not know what it is.

Any help is appreciated, thank you.

Rilliams

Configuration: Windows XP Internet Explorer 7.0

Best answers for « If Statement in Macro » in :
Excel - Using IF statement to add 1 to total Show Excel - Using IF statement to add 1 to total Issue Solution Note Issue I am trying to get a formula to add + 1 to a total cell based on the word typed. Example : If I type the word Duty in cells B3:B18 then add + 1 to cell B35. If...
Repainting a cell using excel VBA ShowRepainting a cell using excel VBA Issue Solution Note Issue I am writing a code in excel VBA to generate a report.I am totally new to VBA.Here's my code Private Sub CommandButton1_Click() Dim a1 As Integer Dim d1 As Integer Dim...
[Myth] aMSN allows you to know if someone has blocked you on WLM ShowaMSN allows you to know if someone has blocked you on Windows Live Messenger Myth Reality Explanations Myth aMSN software allows us to know who blocked us on Windows Live Messenger. Reality FALSE Explanations When it was launched,...
[VBA] Detecting changes in cell Show[VBA] Detecting changes in cell The Event Change feature of a sheet will detects the change in the active cell but it gives no information about the content. The example given below will help you to find out if the cell was changed,...
Spreadsheets - Conditional expressions ShowWhat is a Conditional Structure? Conditional structures are instructions that allow to test if a condition is true or not. Conditional structures may be associated together. To successfully execute these tests using logical functions, spreadsheets...

1

 Excelguru, on May 29, 2009 9:42:17 am BST

Hi
If you put J1 excel takes it as a variable with name J1
To refer to a range use Range("J1").value

Let me know whether this helps... Winners are losers who got up and gave it one more try. -Dennis DeYoung
My Interests are financial Modelling and custom excel development.

Reply to Excelguru