View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Sub procedure in Macros

a simple idea for you

Sub picksheet()
Sheets(InputBox("Sheet?")).Select
Columns(InputBox("col ltr")).Select
End Sub

--
Don Guillett
SalesAid Software

"Lady Excel" <Lady
wrote in message
...
I am trying to insert a 3rd sub procedure to pick a certain worksheet when
a
variable is entered in a input box. I can get it to pick a column but it
won't pick a sheet. Does anyone know what I am doing wrong?
Here is what I have done.
Public Sub Show_Histogram()
'
' Histogram Macro
' This macro displays the contents of the Histogram worksheet.
'

'

Dim Source
Source = InputBox("Enter a filler (A-E)", "Specify Bottle Filler")
Source = UCase(Source)
If Source = "A" Or Source = "B" Or Source = "C" Or Source = "D" Or Source
=
"E" Then
ActiveWorkbook.Names.Add Name:="Histogram", RefersToR1C1:="=Histogram"
&
Source
ElseIf Source < "" Then
MsgBox "Please enter a letter from A to E", vbCritical, "Invalid
Filler"
End If
End Sub

Any help would be appreciated.