LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default combo box nightmare

Hi de hi

I am using a combo box (cmbindivlist) on a form (frmindiv) which is
populated from a column on form (d1) to view existing worksheets or create a
new one if it doesn't exist!

I am using:


Private Sub cmdviewi_Click()

If Cmbindivlist.ListIndex -1 Then
indivsh = Cmbindivlist.Name
If sheetexists(indivsh) Then

Sheets(Cmbindivlist.Name).Select

Else: Call makesheeti

End If
Sheets(indivsh).Visible = True
Range("a1:a1").Select
End If

End Sub

the sheetexsts function is in a separate module:

Public Function sheetexists(ByVal indivsh) As Boolean
' Returns TRUE if sheet exists in the active workbook
Dim x As Object
On Error Resume Next
Set x = ActiveWorkbook.Sheets(indivsh)
If Err = 0 Then sheetexists = True Else: sheetexists = False

End Function
(obtained and tweaked from this site)


but when I break on the cmdviewi sub I notice that indivsh is "" result....
a new sheet created called cmbindivlist.

I know I'm probably missing something really simple but hey...that's me.

I would really appreciate any help

And worry...I have more.

Thanks in advance.
--
Jabba
 
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
nightmare formula [email protected] Excel Worksheet Functions 4 March 15th 09 10:36 AM
PivotTable Nightmare Sandi Excel Discussion (Misc queries) 3 March 3rd 07 04:34 PM
PivotTable Nightmare MarkM Excel Discussion (Misc queries) 1 August 14th 06 07:41 PM
VBA Autofilter nightmare Jmbostock[_9_] Excel Programming 11 January 29th 04 12:24 AM
Protection nightmare Joe Bannister Excel Programming 1 January 27th 04 05:15 PM


All times are GMT +1. The time now is 07:49 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"