ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro help (https://www.excelbanter.com/excel-programming/324954-macro-help.html)

[email protected]

Macro help
 
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


Bob Phillips[_6_]

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





All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com