ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Popup input-form on focus (https://www.excelbanter.com/excel-programming/325691-popup-input-form-focus.html)

Filips Benoit

Popup input-form on focus
 
Dear All,

How can i get a popup input-form when the cell has the focus or with a
shotcut.
I want to insert several lines of text in a small cel.
The cell must stay small on the sheet because it is rarely used .

Thanks,

Filip



Nigel

Popup input-form on focus
 
Put this behind the sheet you wish to control. The cell actioned is set by
the the line "If Target.Column = 1 And Target.Row = 1 Then" change the
values to suit your needs. Currently it is set to Cell A1. If you change the
line to "If Target.Column = 1 Then" only then all cells in column 1 will
trigger this action.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1 Then
ActiveCell.Value = InputBox("Enter Text", "Small CellText Editor",
ActiveCell.Value)
End If
End Sub

--
Cheers
Nigel



"Filips Benoit" wrote in message
...
Dear All,

How can i get a popup input-form when the cell has the focus or with a
shotcut.
I want to insert several lines of text in a small cel.
The cell must stay small on the sheet because it is rarely used .

Thanks,

Filip





Andibevan[_2_]

Popup input-form on focus
 

"Filips Benoit" wrote in message
...
Dear All,

How can i get a popup input-form when the cell has the focus or with a
shotcut.
I want to insert several lines of text in a small cel.
The cell must stay small on the sheet because it is rarely used .

Thanks,

Filip


-----------------------------------------
Filip,

Go into the code for the sheet you want to edit (right click on the sheet
from within the VBA editor).

Then you can use something like this:-

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Address = "$C$1" Then
Application.Run "Filter_Document"

Else
' Range("F10").Value = False
End If
Application.EnableEvents = True


End Sub

For this example, when a change is recognised in cell C1 it runs the macro
Filter_Document. With this you have to press enter for the macro to run.

Some-one else may be able to tell you if there is a way to run a macro when
you click on a cell.

Regards

Andi






All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com