LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Macro Error in 2003

The code below is part of a macro that I wrote in Excel 2000.
When I run it in 2003, it errors out (Application Error) in the last row of
code.

Any ideas how to fix this? Could it have something to do with add-ins?

Is there a way to re-write the last line to work in 2003?

TIA.

NumRowsTB = Range("A65536").End(xlUp).Row

NumRowsMacro = ThisWorkbook.Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row

NumColsMacro = ThisWorkbook.Sheets(2).Cells(1,
Columns.Count).End(xlToLeft).Column

ColumnID = ThisWorkbook.Sheets(2).Cells(1, NumColsMacro).Address

NormalHomeRng = "[" & ThisWorkbook.Name & "]" & ThisWorkbook.Sheets(2).Name
& "!$A$1"

NormalColRng = "[" & ThisWorkbook.Name & "]" & ThisWorkbook.Sheets(2).Name &
"!$B$1:" & ColumnID & ""

NormalRowRng = "[" & ThisWorkbook.Name & "]" & ThisWorkbook.Sheets(2).Name &
"!$A$2:$A$" & NumRowsMacro & ""

Cells(1, 7) = "=IF(ISERROR(OFFSET(" & NormalHomeRng & ",MATCH(C1," &
NormalRowRng & ",0),MATCH(A1," & NormalColRng & ",0))),"""",OFFSET(" &
NormalHomeRng & ",MATCH(C1," & NormalRowRng & ",0),MATCH(A1," & NormalColRng
& ",0)))"
 
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 2003 accepting error message in macro BJ&theBear Excel Discussion (Misc queries) 2 May 25th 10 06:21 PM
Office Excel 2003 Macro error with .xls files Dan R Excel Discussion (Misc queries) 1 April 23rd 09 04:07 PM
2003 macro generates compiler error on 2007 KenInPortland Excel Worksheet Functions 2 September 2nd 08 09:45 PM
Error in Macro 2003 Lisa Excel Discussion (Misc queries) 2 January 16th 08 01:36 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


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