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: 71
Default Qn: Define a variable in Initialize for Userform

Hello Everyone,

How do I define a variable in order to use in the initialize part of a
userform. I am using John's Walkenbach's Help File example and I wanted the
program to default to a certain Help File based on info provided in 1 cell.
I have 4 airplanes, the airplane is selected in Cells(30,1). Based on which
airplane I select gives the topic number to start off with. This is what I
have below, but when I run it, I get errors, it doesn't like Airplane.Text,
because I don't think it is defined anywhere??. How can I read what
airplane is in the cell to select the correct topic??
(This code does NOT work)

Airplane.Text = Cells(30, 1)
If Airplane = "N2AJ" Then CurrentTopic = 1
If Airplane = "N9421D" Then CurrentTopic = 2
If Airplane = "N74NM" Then CurrentTopic = 3
If Airplane = "N146K" Then CurrentTopic = 4 Else CurrentTopic = 1



 
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
Define Variable Name using VBA GTReferee Excel Discussion (Misc queries) 2 January 21st 09 06:37 PM
Userform Initialize & combo box values michaelberrier Excel Discussion (Misc queries) 3 June 27th 06 04:35 PM
Userform disappears when you try to initialize from a command button RPIJG[_60_] Excel Programming 8 July 2nd 04 08:14 PM
Define variable range acberry Excel Programming 2 May 12th 04 02:44 PM
Generic questions about variable scope the Initialize event TBA[_2_] Excel Programming 4 January 12th 04 03:42 PM


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