message prompts in VBA

VBAmalta89

Board Regular
Joined
Mar 25, 2011
Messages
116
I have a user form and I need to check a value of a cell in a particular worksheet when the user inputs chooses data from a combo box.

If the value of this cell in the worksheet is >0 then a message is prompted otherwise the program can continue normally.

How can i do this in VBA?
 
ok your code seems to be working but there is one slight problem.

What if it needs to check column D rather than column B, how do i alter the code?

and how do i change the row number
 
Last edited:
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
To look in column D:

Rich (BB code):
If Range(.RowSource).Cells(.ListIndex + 1, 4).Value <= 0 Then

I do not know what you mean by "change the row number".
 
Upvote 0
never my mistake i got confused for a while that why.

It worked perfectly for me

thanks very much for your help and time
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top