Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Richard
 
Posts: n/a
Default If Statment - Active Cell Column Address

Need to use an if statement in a macro to control program flow.

If active cell is in column C then €¦€¦€¦€¦.

Else €¦..

End if

How do I do this???

Thanks in Advanced

Richard

--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default If Statment - Active Cell Column Address

If activecell.column=3 then .....

HTH

"Richard" wrote:

Need to use an if statement in a macro to control program flow.

If active cell is in column C then €¦€¦€¦€¦.

Else €¦..

End if

How do I do this???

Thanks in Advanced

Richard

--
Richard

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default If Statment - Active Cell Column Address

Another way:

with activesheet
if intersect(activecell, .range("C:C")) is nothing then
'not in column C
else
'do what you want
end if
end with

This can come in handy if you want to adjust that range to check:

with activesheet
if intersect(activecell, .range("C:E, G1:H9, L:M")) is nothing then
'not in columns C:E, L:M or in G1:H9
else
'do what you want
end if
end with

Richard wrote:

Need to use an if statement in a macro to control program flow.

If active cell is in column C then €¦€¦€¦€¦.

Else €¦..

End if

How do I do this???

Thanks in Advanced

Richard

--
Richard


--

Dave Peterson
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
conditional cell format based on cell in same row, previous column tamiluchi Excel Worksheet Functions 7 May 3rd 06 04:11 PM
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Charts and Charting in Excel 0 March 1st 06 01:05 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
How do I reference every "n" cell in a column in Excel? Alma Excel Worksheet Functions 2 March 22nd 05 06:19 PM


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