Excel VBA Question

Thelingly95

New Member
Joined
Nov 1, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
How would you create a pop out box when you click on a cell? It would contain all of the information in the cell, but would display it in a larger box.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
One way would be to use a comment....so, click on the cell in question....go to the Insert Tab, then select the Comment item.
Fill in the required data in the text window.
Then next time you click on that cell the comment window will open.
 
Upvote 0
Welcome to the MrExcel board!

One way might be this, but it could become very annoying. :eek:
To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test.
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  With Selection
    If .Count = 1 Then
      If Not IsEmpty(.Value) Then MsgBox .Value
    End If
  End With
End Sub

A variation to make it less annoying might be to restrict the actions to a particular range or column. For example, only if it is column E
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  With Selection
    If .Count = 1 And .Column = 5 Then
      If Not IsEmpty(.Value) Then MsgBox .Value
    End If
  End With
End Sub

Another variation might be to only show the message box if the cell contents is longer than a certain number of characters.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  With Selection
    If .Count = 1 Then
      If Len(.Value) > 50 Then MsgBox .Value
    End If
  End With
End Sub
 
Upvote 0
One way would be to use a comment....so, click on the cell in question....go to the Insert Tab, then select the Comment item. slope game
Fill in the required data in the text window.
Then next time you click on that cell the comment window will open.
It helped. Many thanks, all!
 
Upvote 0

Forum statistics

Threads
1,223,577
Messages
6,173,164
Members
452,504
Latest member
frankkeith2233

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