Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have a workbook with several sheets. each sheet is a persons name.
i have a macro that i wish to select a certain sheet if certain conditions are met. the variables LastName and FirstName get their values from 2 cells in a sheet where the user would enter the first and last name in 2 different cells, then click a button to activate the sheet with the name they just typed in. Private Sub Commandbutton1_Click() Dim LastName As String, FirstName As String, ShtName As String LastName = Sheets("Members").Range("A1").Value FirstName= Sheets("Members").Range("A2").Value ShtName = LastName & ", " & FirstName Workbooks("Member.xls").Sheets(ShtName).Activate End Sub Can anyone tell me why this does not activate the sheet named: Smith, John A1 = Smith A2 = John TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
referring to sheet in another file | Excel Worksheet Functions | |||
referring to a sheet in another file | Excel Worksheet Functions | |||
Formula referring to a different sheet | Excel Discussion (Misc queries) | |||
Referring to a cell in another sheet | Excel Programming | |||
referring to previous sheet | Excel Discussion (Misc queries) |