Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Excel macros VBA
its giving error on irowtro
error is out of range
please help me
Sub transferorderdata()
Dim wkbor, wkbvl, wkbysd, wkbtr As Workbook
Dim wknm, wknm1, wknm2  As String
wknm2 = "C:\vbproject\tracker\ysdflow2.xlsx"
wknm = "d:\a.xlsx" '-------Open order
wknm1 = "d:\SAMPLE.xlsx" '------tracker file
Set wkbor = Workbooks.Open(wknm)
Set wkbtr = Workbooks.Open(wknm1)
Dim irowor, irowtro, irowtrs As Integer
Dim i, j As Integer
Dim selor, seltro As String
Dim blnor As Boolean
Dim sample As String
'__________________Ordering Compare_________________
irowor = wkbor.Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
irowtro = wkbtr.Sheets("Ordering").Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
Posted 31-Oct-12 2:16am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Change the declaration of irowtro from Integer to Long.
More about data types in VBA:[^]
MS Excel specifications:

Excel 97- 2k365,536 rows by 256 columns
Excel 2k7 and higher1,048,576 rows by 16,384 columns

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Zoltán Zörgő 300
1 /\jmot 205
2 Peter Leow 165
3 CHill60 145
4 CPallini 135
0 Sergey Alexandrovich Kryukov 9,383
1 OriginalGriff 6,881
2 Peter Leow 4,607
3 Zoltán Zörgő 4,284
4 CHill60 2,892

Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 1 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100