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: 8
Default macro OK in Excel 2003 but NOT in Excel 2000

I can run to following code in Excel 2003 but when I run it in Excel 2000 I
get an error/debug at the line Set rngFrom = <<<

Should I declare different variables because of 2000 version?

****
Sub ADP_ExportExcel()
'transpose horizontal column output (multiCol) into single column
(vertical)
Dim rngFrom As Range
Dim rngTo As Range
Dim rng As Range
With Sheets("sheet1")
Set rngFrom = .Range(.Range("A1"), .Cells(Rows.Count, "A").End(xlUp)) <<

End With
Set rngTo = Sheets("sheet2").Range("A1")
For Each rng In rngFrom
rngTo.Value = rng.Value
rngTo.Offset(1, 0).Value = rng.Offset(0, 1).Value '2 columns
rngTo.Offset(2, 0).Value = rng.Offset(0, 2).Value '3 columns
rngTo.Offset(3, 0).Value = rng.Offset(0, 3).Value '4 columns
Set rngTo = rngTo.Offset(4, 0) 'number of rows per item
Next rng
End Sub

--
AncientLearner
....never to old to learn something new
 
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 and 2000 and VBA Macro Trobert1 Excel Programming 2 February 6th 08 04:58 PM
Problems when using macro created in Excel 2000, in Excel 2003 Vlada Excel Programming 2 July 27th 06 04:24 PM
Run time error : Excel 2000 and Excel 2003 : different behavior of Macro Bala[_2_] Excel Programming 2 May 23rd 06 05:15 AM
Macro error after switching from Excel 2000 to Excel 2003 Jake Burnham Excel Discussion (Misc queries) 1 January 10th 06 08:10 PM
Macro written in Excel 2003 and saved as Excel 2000 .xls Chip Pearson Excel Programming 0 September 2nd 04 03:30 AM


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