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: 85
Default Select....Case macro in Excel 2007


I am using this macro, taken from "Mr. Excel" Bill Jelen's book, which was
written in 2004. I have Excel 2007, and I don't know if something has
changed. I use Watch feature when debugging this. The expression "i" seems
to work, but nothing shows up in expression "Value". The debugger reads,
"<Expression not defined in context. Any suggestions are appreciated.


Sub CopyPasteSurcharges()
'
'Macro to copy Surcharges from existing fields and move to new fields
'
Sheets("Ground").Activate
FinalRow = Cells(65536, 55).End(xlUp).Row

For i = 2 To FinalRow
Select Case Cells(i, 55).Value
Case "Additional Handling"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 79)
Case "Additional Weight"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 81)
Case "Address Correction"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 83)
Case "Adult Signature"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 85)
Case "Call Tag"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 87)
Case "COD"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 89)
Case "Courier Pick-Up Charge"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 91)
Case "Declared Value"
Range(Cells(i, 55), Cells(i, 56)).Copy
Destination:=Cells(i, 93)
End Select
Next i
End Sub
 
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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Excel Select Case with HorizontalAlignment Derrick Salmon Excel Programming 1 November 30th 06 04:48 PM
Calling Macro when using Select Case helmekki[_49_] Excel Programming 1 October 30th 04 12:22 AM
Excel Custom Function with Select Case Heather[_7_] Excel Programming 14 November 6th 03 11:37 PM


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