MessageBox for 2 cells

reeceb

New Member
Joined
Jun 8, 2011
Messages
10
Greetings,

I have a spreadsheet that I want to display a MessageBox if a value in a cell changes. I am building a Cisco device configuration generator.

I have done some conditional formatting so if the device selection is a router then all cells relating to switches are invisible. Vice versa if the device selection is a switch (all related to routers are invisible).

The next (data validated) field is the device selection. I would like to display a MessageBox for the user to verify the IOS before proceeding. Ideally, I would like the messageBox to display the correct IOS version (lookup from an array), but would be happy with just a messagebox.

Can anyone help, please ?

Reece...
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
This will display a message when you make a change to cell A1

  • Right-click on the sheet tab
  • Select View Code in the pop-up menu
  • Paste the code below in the VBA edit window
  • Change the A1 (red) in the code to the cell that you want this to work on

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Target.Address(0, 0) = "[COLOR="Red"]A1[/COLOR]" Then
        If Target.Value <> "" Then
            'Lookup IOS somewhere
            'IOS = Application.WorksheetFunction.VLookup(Target.Value, Range("C:D"), 2, 0)
            MsgBox Prompt:="Please verify the IOS before proceeding. ", _
                   Buttons:=vbExclamation + vbOKOnly, _
                   Title:="Verify IOS"
        End If
    End If
        
End Sub

Not enough details to do the lookup portion of the code.
 
Upvote 0
Fantastic. Thanks heaps for your help. Makes it heaps easier when being assisted by very clever people.

Reece...
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,841
Members
452,948
Latest member
UsmanAli786

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