Excel Pop Out cell contents for entire worksheet

QTQ28

New Member
Joined
Sep 5, 2024
Messages
16
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hi Friends! I'm not a brainy code person, so I need help here fromt his amazing group of code wizards. I'm working on a spreadsheet where I have the text wrapped, but being that some cells have a lot of text, and I want to keep the cells small for visual appeal, I really want to find a way for the text of the cell to pop out for easy reading which i click on it. Can someone help please?
 
Add a real simple Macro like this in the VBA section of that workbook:
VBA Code:
Sub Test()
    MsgBox "VBA is enabled!"
    MsgBox Application.EnableEvents
End Sub
And try running it and see if it returns any messages.
If it does, please tell me what the second message returns.
Hi Joe - is there a way to make it so the pop out box becomes editable? Like click on cell, box pops out, and then I can edit the text?
1729173213814.png
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Joe - is there a way to make it so the pop out box becomes editable? Like click on cell, box pops out, and then I can edit the text? View attachment 118186
You would need to use an InputBox instead of a MsgBox, i.e.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Dim ib As String
    
'   Only run if a single cell is selected
    If Target.CountLarge > 1 Then Exit Sub

'   Only run if a cell in column G is selected
    If Not Intersect(Target, Range("G:G")) Is Nothing Then
        ib = InputBox("Enter/edit text for this cell", "UPDATE CELL", Target.Value)
        Application.EnableEvents = False
        Target.Value = ib
        Application.EnableEvents = True
    End If
    
End Sub
 
Upvote 0
You would need to use an InputBox instead of a MsgBox, i.e.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Dim ib As String
   
'   Only run if a single cell is selected
    If Target.CountLarge > 1 Then Exit Sub

'   Only run if a cell in column G is selected
    If Not Intersect(Target, Range("G:G")) Is Nothing Then
        ib = InputBox("Enter/edit text for this cell", "UPDATE CELL", Target.Value)
        Application.EnableEvents = False
        Target.Value = ib
        Application.EnableEvents = True
    End If
   
End Sub
shoot - that was visually really unappealing and when you close the box it seems to have deleted the text. and then when I tried to undo it to get the text back, it bounced me to a different spreadsheet all together. really odd. I'll stick with the other pop out box you can't edit.
 
Upvote 0
Yes, a MsgBox can only return a message to the screen - there are no editing options on it.

We can update the code so that it does nothing if they hit the Cancel button.
Here is that update:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Dim ib As String
    
'   Only run if a single cell is selected
    If Target.CountLarge > 1 Then Exit Sub

'   Only run if a cell in column G is selected
    If Not Intersect(Target, Range("G:G")) Is Nothing Then
        ib = InputBox("Enter/edit text for this cell", "UPDATE CELL", Target.Value)
'       Exit if user hits Cancel
        If StrPtr(ib) = 0 Then
            Exit Sub
'       Otherwise update cell
        Else
            Application.EnableEvents = False
            Target.Value = ib
            Application.EnableEvents = True
        End If
    End If
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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