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: 1
Default Enlcosing code inside if- then no longer works

The following works as expected:

ActiveCell.Select
ActiveCell.FormulaR1C1 = "km-KH: HB for TP 1 Build"
Key = Left(ActiveCell, 18)
Sheets("All").Select
'If Key = "Km-KH: HB for TP 1" Then
Cells.Find(What:="km-KH: HO of TP 1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
'End If
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.Copy
Sheets("Test").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Range("A1").Select

If I don't comment out the If and End If statments, it fails. Note the
correct value gets assigned to the variable Key. What am I doing wrong? Any
help for this novice would be greatly appreciated.
 
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
VBA code for excel 2000 no longer works in excel 2007 Blaine[_3_] Excel Programming 8 October 4th 08 01:45 PM
Format code no longer works CLR Excel Programming 5 May 22nd 07 12:25 AM
Code No Longer Works in 2007 Chaplain Doug Excel Programming 2 February 6th 07 06:12 PM
folderexists code no longer works after moving to excel 2003 sdharris - ExcelForums.com Excel Programming 1 May 2nd 05 09:57 AM
VB6 Excel 97 code no longer works if Win2K SP3/4 applied. Tim R[_3_] Excel Programming 5 October 10th 04 06:24 AM


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