LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
I.P I.P is offline
external usenet poster
 
Posts: 5
Default If/Then

I wish to move to the next worksheet if the current worksheet has the
text "no" in cell C21.I keep getting the message no "For or Goto" when
I put a If /Then line in the code. All the worksheets are the same
setup.

Dim nm As String
Dim x, y As Integer
Sheets("DontDelete").Select
x = Range("DontDelete!J6").Value
Range("I8").Select
For y = 1 To x
nm = ActiveCell.Value
Sheets(nm).Select
Range("Q2:AD2").Select
Selection.Copy
Sheets("Timesheet").Select
Range("A19").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Sheets("DontDelete").Select
ActiveCell.Offset(1, 0).Activate
Next y

 
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



All times are GMT +1. The time now is 08:49 PM.

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"