How to display message box in macro

Asked By 20 points N/A Posted on -
qa-featured

I have developed a macro in Excel which will prompt to enter 2 cell numbers. My plan is that it will display a message box which shows the cell numbers entered by the user. But the message box is showing ‘TRUE’ instead of the cell number entered by the user. Please give me the solution.

SHARE
Best Answer by Riley weaver
Answered By 5 points N/A #94725

How to display message box in macro

qa-featured

 

Hi Cara,

As you developed a macro which will prompts to enter 2 cell numbers and will display cell numbers entered by user with a message box. However message box is showing “TRUE” instead of the cell number. I would suggest you to use below code for message box to display cell value:

MsgBox "User Entered: " & " " & Range("A" & n).Value

Where n is any integer value (Dim n) which will help you in locate the cell number for which you want to display message.

Best Answer
Best Answer
Answered By 10 points N/A #94726

How to display message box in macro

qa-featured

Hello Cara,

As you developed that macro, I am sure that you are very good with visual basic language. I can make sure that almost everything is fine just one variable misplaced. Just check the variables in the lower part of the script. Please check the conditions and variables in there. I love languages. Now for those people who don't know about macros, for them I want to say that it is an easy work and using this you can create your own kind of work environment.

Thank you,

 Riley Weaver.

Related Questions