#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Open Sheet

Excel 2000
I want the user to click on a down arrow in a cell and open a second sheet.
Then the total from a cell in the second sheet would populate the cell in the
first sheet with the down arrow. I added a combo box to the first sheet and
used the "Linked Cell" and "ListFillRange" properties. That works, but how do
I open the second sheet by clicking on the down arrow?

Thanks,

Howard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Open Sheet

What exactly are you selecting from the combo box. If you are selecting the
sheet name then here is some code for you...

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
If Target.Address = "$B$2" Then Sheets(Target.Value).Select

Exit Sub
ErrorHandler:
MsgBox "Sheet " & Target.Value & " does not exist. Please Try again",
vbCritical, "Sheet Error"
End Sub

It assumes that you are selecting the sheet name and that the combo box is
in Cell B2. You add this code by right clicking on the tab you want and
selecting view code.

HTH

"Howard" wrote:

Excel 2000
I want the user to click on a down arrow in a cell and open a second sheet.
Then the total from a cell in the second sheet would populate the cell in the
first sheet with the down arrow. I added a combo box to the first sheet and
used the "Linked Cell" and "ListFillRange" properties. That works, but how do
I open the second sheet by clicking on the down arrow?

Thanks,

Howard

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Open Sheet

Jim,
Thanks!
Someone told me it's possible to put a combo box on a sheet (sheet 1), click
on the down arrow of the combo box, which would open sheet 2.
I think I can do what I want to do using a command button.
Howard

"Jim Thomlinson" wrote:

What exactly are you selecting from the combo box. If you are selecting the
sheet name then here is some code for you...

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
If Target.Address = "$B$2" Then Sheets(Target.Value).Select

Exit Sub
ErrorHandler:
MsgBox "Sheet " & Target.Value & " does not exist. Please Try again",
vbCritical, "Sheet Error"
End Sub

It assumes that you are selecting the sheet name and that the combo box is
in Cell B2. You add this code by right clicking on the tab you want and
selecting view code.

HTH

"Howard" wrote:

Excel 2000
I want the user to click on a down arrow in a cell and open a second sheet.
Then the total from a cell in the second sheet would populate the cell in the
first sheet with the down arrow. I added a combo box to the first sheet and
used the "Linked Cell" and "ListFillRange" properties. That works, but how do
I open the second sheet by clicking on the down arrow?

Thanks,

Howard

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
ON OPEN VBA Code input incorrectly now excel sheet wont open mmartin New Users to Excel 1 February 16th 11 11:33 PM
Why does a Multi-sheet/user file open on sheet two every time? Frustrated in NJ Excel Discussion (Misc queries) 1 January 22nd 10 05:46 PM
why, when i open a work sheet does a blank sheet open as well John Excel Discussion (Misc queries) 2 July 7th 07 06:20 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM


All times are GMT +1. The time now is 10:22 AM.

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

About Us

"It's about Microsoft Excel"