Hi there I have attached a simple spreadsheet with a table in it All the cells except the headers in the tables are conditional formatted so that if i select a cell in the table as No, the colour of the cell turns red if i select Yes, the cell color turns green and if i select NA, the cell color turns orange.
My code is below If strOnG8 = "Yes" and Range(RangeFinder("A") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Welcome to Hotel " + HotelName ElseIf strOnH8 = "Yes" and Range(RangeFinder("B") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Welcome to Hotel " + HotelName ElseIf strOnI8 = "Yes" and Range(RangeFinder("C") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Welcome to Hotel " + HotelName ElseIf strOnJ8 = "Yes" and Range(RangeFinder("D") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Welcome to Hotel " + HotelName End If If strOnG8 = "NA" and Range(RangeFinder("A") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Sorry, please signup at " + HotelName ElseIf strOnH8 = "NA" and Range(RangeFinder("B") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Sorry, please signup at " + HotelName ElseIf strOnI8 = "NA" and Range(RangeFinder("C") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Sorry, please signup at " + HotelName ElseIf strOnJ8 = "NA" and Range(RangeFinder("D") + strCurrentRow).Value2 Then strcode = "Hi " + PersonName + " Sorry, please signup at " + HotelName End If 'RangeFinder, strcode, PersonName and HotelName are all global variables called in different functions withinin the code and they are all working fine. There is no dependency of them to the above code When i need to select a particular row as Yes or NA, my IF statement is breaking logic in picking the right strcode value independent of whatever the values are in the other cells in the table Can u please suggest a fix for this -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,700 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe