Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Conditional Formatting based on active Named Range; IF Function to VBA

Hey,
I have more than 3 conditional formatting and I have more than 3 IF
statements in the function - I have 4. The function for four IF
statements in my case is listed below. How would I write this as a
VBA function?

I have numbers in column A, I have to identify, based off 4 active
named ranges, who the numbers belong to. For example, if the number
in A3 is 9004, the function/code would lookup up and find 9004 under
the active named range called SEA_ID and then would put in the B3
column SEA.

Any ideas are welcomed, thank you. Bull

=IF(COUNTIF(SEA_ID,A3),"SEA",IF(COUNTIF(SPO_ID,A3) ,"SPO",IF(COUNTIF(BUT_ID,A3),"BUT",IF(COUNTIF(ANC_ ID,A3,"ANC",""))))

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,522
Default Conditional Formatting based on active Named Range; IF Functionto VBA

On Dec 1, 1:28*pm, Todd wrote:
Hey,
I have more than 3 conditional formatting and I have more than 3 IF
statements in the function - I have 4. *The function for four IF
statements in my case is listed below. *How would I write this as a
VBA function?

I have numbers in column A, I have to identify, based off 4 active
named ranges, who the numbers belong to. *For example, if the number
in A3 is 9004, the function/code would lookup up and find 9004 under
the active named range called SEA_ID and then would put in the B3
column SEA.

Any ideas are welcomed, thank you. Bull

=IF(COUNTIF(SEA_ID,A3),"SEA",IF(COUNTIF(SPO_ID,A3) ,"SPO",IF(COUNTIF(BUT_ID, A3),"BUT",IF(COUNTIF(ANC_ID,A3,"ANC",""))))


suggest using select case. Look in vba help
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 formatting when text is contained in a named range Hugh Excel Discussion (Misc queries) 2 July 31st 09 02:35 PM
Conditional formatting 'Named Range' dilemma Blue Max Excel Worksheet Functions 4 December 22nd 08 10:16 PM
Conditional Formatting - 2 Worksheets one Named Range Sam via OfficeKB.com Excel Worksheet Functions 5 January 27th 07 04:00 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
Conditional formatting if value in cell is found in a named range Grumpy Grandpa Excel Worksheet Functions 5 April 15th 06 04:30 PM


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