Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Sub procedure in Macros

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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
how do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM
Is there a simple procedure to set my macros in Excel 2003 to be . shelley New Users to Excel 1 April 22nd 05 10:04 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM


All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"