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: 1
Default Using cell name to call userform

Hi there I have a worksheet form that has vba to manage it what i am stuck on
is i want to take the name of an active cell add the word "form" to it and
then use this to call a userform

I expect to have more user forms than below in time
here is the code I have been using (if thens etc)

Public Sub cellnames()
Dim cellname As Name
Dim cellval

On Error Resume Next
Set cellname = Selection.Name
If cellname Is Nothing Then
Exit Sub
Else
If cellname.Name = "Reason" Then
reasonform.Show
End If
If cellname.Name = "carecategory" Then
carecategoryform.Show
End If
If cellname.Name = "Team" Then
Teamform.Show
End If
If cellname.Name = "caretype" Then
Caretypeform.Show
End If
If cellname.Name = "Eligibility" Then
eligibilityform.Show
End If
End If

End Sub

What i want to be able to do is something like

list = worksheets("panel form").range("formlist") ' would store list on
hidden worksheet
for each list in formslist
if cellname.name = list then ' say cellname.name = team
showform = list & "form" ' say list = team
showform.show ' i actually want to show user form teamform not showform
end if
next

Would be gfrateful for some help as the later code is far tidier and would be
easier to manipulate.

Thanks
Paul
 
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
Macro to call-up UserForm Mr. G. Excel Worksheet Functions 0 August 24th 06 09:24 AM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Problem with Blocking Dynamically generated UserForm Call vmegha Excel Programming 4 December 21st 05 12:39 PM
MSForms UserForm Window Handle - Win32 API Call from VBA Sean Connolly[_3_] Excel Programming 2 October 6th 05 05:10 PM
Is it possible to call a UserForm multiple times? Doug[_9_] Excel Programming 4 January 13th 04 07:12 PM


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

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"