Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Some Basic Doubts in Excel Macro

Iam a Leaner of excel macro by using the examples in this
News group because of that i get some simple but serious
doubts some times

I have some more doubts in macro CAN YOU HELP ME please!!


1) Is it possibe to activate an Userform or List Box by
hitting one Key, (in Foxpro it is ONKEY Label...")

2) while giving conditions we use
" if a = "xxx" then ....." etc .....

but how to say
"if a (isnot equal) "xxx" ......"
( other than "else" ..... Condition)

3) while giving conditions we use "if ... then ...
endif ..."statements is it possible for using one
more "if .. then.. endif"
statement in between that statement , if yes how
many "endif" we have to use at the end

PLEASE GIVE ME SOME EXAMPLES ALSO


Tks & regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Some Basic Doubts in Excel Macro

Hi Manu,

1) Is it possibe to activate an Userform or List Box by
hitting one Key, (in Foxpro it is ONKEY Label...")


If your sub that shows the form is called "SubThatShowsTheForm", then
this codeline will attach that sub to control-shift-s:

Application.Onkey "^+s", "SubThatShowsTheForm"

2) while giving conditions we use
" if a = "xxx" then ....." etc .....


but how to say
"if a (isnot equal) "xxx" ......"
( other than "else" ..... Condition)


If a < "xxx" Then


3) while giving conditions we use "if ... then ...
endif ..."statements is it possible for using one
more "if .. then.. endif"
statement in between that statement , if yes how
many "endif" we have to use at the end


You can nest them:

If A=1 Then
If a=2 Then
Msgbox "A= 2"
Else
Msgbox "A is 1"
End If
Else
Msgbox "A is neither 1 nor 2"
End If

Or:

If A=1 Then
Msgbox "A is 1"
ElseIf a=2 Then
Msgbox "A= 2"
Else
Msgbox "A is neither 1 nor 2"
End If

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

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
excel doubts mehvish91 Excel Discussion (Misc queries) 12 October 17th 08 11:06 AM
Microsoft Excel doubts [email protected] Excel Discussion (Misc queries) 2 March 18th 08 01:58 PM
Addin for Excel - general doubts Dotnet Newbie Excel Programming 0 July 28th 04 01:27 PM
Excel Macro Basic Help Adam[_9_] Excel Programming 2 May 18th 04 02:45 PM
visual basic macro in excel Patrick Molloy Excel Programming 0 July 23rd 03 07:49 AM


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