Thread: Macro help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Macro help

Riri,

It works fine for me.

Sheet1 is the worksheet codename, not name. Are you sure that you don't mean

j = Worksheets("Sheet1").Range("A3").Value
k = Worksheets("Sheet2").Range("A2").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
ups.com...
Hello all,

I have a weird or logical error that I dont know what it is.

Dim j, k

j = Sheet1.Range("A3").Value
k = Sheet2.Range("A2").Value

If ((j) = (k)) Then
MsgBox ("hello")
End If

Even though the A3 = 7 and A2 = 7

Can anyone help?

Thanks in advance

Riri