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 Macro Errors


I have two sheets, one with a customer name and corresponding carriag
cost (named carriage) and one with customer name and many other column
of information including a blank space for carriage cost (name
customer.) The customer names are in different orders on the tw
different sheets.

I have wrote the below code which copies the carriage cost from shee
carriage into sheet customer which works until a customer that is o
the carriage sheet is not on the customer sheet. I would like the macr
to highlight the customer on the carriage sheet that is not on th
customer sheet and then continue with the macro.

Any ideas? Thank you for your help. Code below.

Sub carriagemove()
'
' carriagemove Macro
' Macro recorded 14/07/2005 by James Fuggle
'

'
Dim swop As String
Dim rw As String

Sheets("Carriage").Select
Range("A300").Select
ActiveCell.FormulaR1C1 = "Grand total"
Range("A1").Select
Cells.Find(What:="Grand total", After:=ActiveCell
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
Application.CutCopyMode = False

rw = ActiveCell.Row
Range("A1").Select

Do While ActiveCell.Row < rw
Sheets("Carriage").Select

ActiveCell.Offset(1, 0).Select

swop = ActiveCell

ActiveCell.Offset(0, 1).Select
Selection.Copy

Sheets("Customers").Select

Cells.Find(What:=swop, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows
SearchDirection:= _
xlNext, MatchCase:=False).Activate
Application.CutCopyMode = False

If ActiveCell.Row = rw Then Exit Do

ActiveCell.Offset(0, 7).Select

Sheets("Carriage").Select
Selection.Copy

Sheets("Customers").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False

Sheets("Carriage").Select
ActiveCell.Offset(0, -1).Select

Loop

End Su

--
fugfu
-----------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...fo&userid=2495
View this thread: http://www.excelforum.com/showthread.php?threadid=39323

 
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
Excel Macro Errors - it just doesn't like Word Chappy Excel Discussion (Misc queries) 9 February 8th 09 08:08 PM
Sum column with errors, Macro Danny Excel Worksheet Functions 2 April 4th 08 05:42 PM
Errors in VB Code since adding macro Susan Excel Discussion (Misc queries) 1 April 11th 06 08:42 PM
Macro Errors [email protected] Excel Programming 1 May 26th 05 12:28 PM
Excel 97 Macro Compile Errors Simon[_15_] Excel Programming 1 May 10th 04 01:37 PM


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