Click here to Skip to main content
Rate this: bad
good
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
thanks
akshay
Posted 31-Oct-12 2:16am
aksh619297

1 solution

Rate this: bad
good
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: http://office.blogs.webucator.com/2010/11/30/data-types-in-vba/[^]
 
MS Excel specifications:

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

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

  Print Answers RSS
0 OriginalGriff 295
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 174
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 1 Nov 2012
Copyright © CodeProject, 1999-2014
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