Pop-up with supplemental info using VBA

Spreadthemsheets

New Member
Joined
Sep 29, 2016
Messages
9
Hi all,

Thanks in advance for any help that you can provide. I haven't used VBA in years, but I'd like to get back into it and I'm having some trouble.
Here is the scenerio:

I have a product description and a range of values as percentage in cells H12:K12. I need to have a pop-up message with some background info on the percentages (mostly just contextual and for informative purposes only )displayed when a user selects any of the cells in that range.
A different message will need to be displayed if the user selects a cell in L12:O12 and again for P12:S12. So there are 3 unique messages for cells cell selection in 3 ranges within row 12. I will need to do the same thing for row 13, and on down the spreadsheet for about 20 rows.

I thought to do this with data validation initially, but the text limit seems to be too small.
 
I see it now. After the THEN in the if statement go to a new line and write Msgbox Msg1 then a new line and end if.

it should look like this

Code:
I
f Not Intersect(Target, Msg2Range) Is Nothing Then 
MsgBox Msg2
End If
 
Last edited:
Upvote 0
What line is the error on when you click debug?

When I hit debug it highlights the "End If" in red text below

Code:
End If


If Not Intersect(Target, Msg2Range) Is Nothing Then MsgBox Msg2
[COLOR=#ff0000]End If[/COLOR]


If Not Intersect(Target, Ms32Range) Is Nothing Then MsgBox Msg3
End If


End Sub
 
Upvote 0
Sorry if you got my last edit and this is redundant. There should be nothing after the THEN in the if statement, you need to start a new line
 
Upvote 0

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