Hello Wall31
Welcome to ExcelFox
I would use the standard VBA InputBox function for something very simple like you are asking for , rather than creating one,
This is the basic coding to get you started. You would normally want to possibly consider some extra lines to check that valid input is given by the user
( You can give the column as a Letter, such as your P , or a number. In both cases just give the character with no quotes, )
Alan
Code:Sub SimpleInputBox() ' Rem 1 VBA input box function https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/inputbox-function Dim Anser As String Let Anser = InputBox(Prompt:="Give Column number or column Letter", Title:="Select Column", Default:="A") Rem 2 select column ActiveSheet.Columns(Anser).Select End Sub




Reply With Quote
Bookmarks