Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do i insert "If function" in a macro?

I have a recorded macro and i would like to insert a condition, if "Y
then copy ove

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do i insert "If function" in a macro?

madcat

Note IF statement tests are case sensitive

if range("a2") = "Y" then
do something
end if


or

if range("a2") = "Y" then
do something
elseif range("b3")="N" then
do something else
else
do some other thing
end if


you can also use Select Case

Select case range("a1")
case "Y"
do something
case "N"
do somr other thing
case "T"
do something else
end selec

--
Message posted from http://www.ExcelForum.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
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Insert "Proper Function" into existing macro jackel[_14_] Excel Worksheet Functions 10 March 10th 08 04:00 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Is it possible to insert a macro command in an "IF" function? SandyLACA Excel Worksheet Functions 4 November 8th 05 10:46 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 08:23 PM.

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"