Click here to Skip to main content
13,049,233 members (71,933 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 1: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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 1 Nov 2012
Copyright © CodeProject, 1999-2017
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