Macro help

  • Thread starter Thread starter eleftheriak
  • Start date Start date
E

eleftheriak

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top