LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Nested If statements

Hi
I'm trying to name a .TXT file opened in excel, if cell A2 contains within
it's value the words "List........".
I was able to name the first "Output1" but on running the code on the
another file error 1004 appeared saying I cannot name the file with the same
name.
Could you explain the error in my code?
Or a different method.

If Range("A2").Value < "List with Date of Birth" Then
ActiveSheet.Name = "Output1"
Else
If Range("A2").Value < "List of School Card" Then
ActiveSheet.Name = "Output2"
Else
If Range("A2").Value < "List of ATSI Students with " Then
ActiveSheet.Name = "Output3"
End If
End If
End If

TIA
--
Thank you

Regards

Bob C
Using Windows XP Home + Office 2003 Pro
 
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
Nested IF statements Valerie Excel Worksheet Functions 2 February 19th 09 03:36 AM
Nested IF statements using AND / OR Joe[_13_] Excel Worksheet Functions 2 February 9th 09 06:14 PM
Help with nested if/or statements Nick Excel Discussion (Misc queries) 8 September 14th 07 03:46 PM
Nested IF statements Karrisac15 New Users to Excel 1 July 19th 07 08:06 PM
what is the max no. of nested Ifs can an If Statements have in EXC StevenE Excel Discussion (Misc queries) 1 June 27th 05 03:03 PM


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