LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 31
Default IF AND ELSE NOT WORKING

Can anybody help explain why the following code does not work?

The value in range D2 is =TEXT($C$2,"DDDDDD"), c2 is todays date

Dim rng As Range

Set rng = ActiveSheet.Range("D2")

With rng
If .Value = "MONDAY" Then
'Do something,
'
Sheets("MON").Select
ActiveSheet.Rows("7:126").Select
Selection.Copy
Sheets("24HR").Select
ActiveSheet.Rows("7:126").Select
ActiveSheet.Paste
Else
If .Value = "TUESDAY" Then
'Do something,
'
Sheets("TUE").Select
ActiveSheet.Rows("7:126").Select
Selection.Copy
Sheets("24HR").Select
ActiveSheet.Rows("7:126").Select
ActiveSheet.Paste
Else
If .Value = "WEDNESDAY" Then
'Do something,
'
Sheets("WED").Select
ActiveSheet.Rows("7:126").Select
Selection.Copy
Sheets("24HR").Select
ActiveSheet.Rows("7:126").Select
ActiveSheet.Paste
Else

End If
End If
End If

End With
 
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
IF not working amandooshna Excel Worksheet Functions 9 March 28th 07 02:11 PM
Sum(if not working Beverly C Excel Discussion (Misc queries) 5 February 6th 07 02:10 PM
if not working Micayla Bergen Excel Discussion (Misc queries) 3 March 13th 06 11:03 PM
was working, now :( Mark B Excel Worksheet Functions 1 January 17th 06 02:40 AM
Working out UK tax hawkeye uk New Users to Excel 6 March 11th 05 04:23 PM


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