PDA

View Full Version : 2003 vs 2007



vzachin
01-10-2011, 09:37 AM
hi,

i have an excel 2007 file that exceeds 65000 rows. is there a way of extracting a few columns (eg: column b, d, e) using excel 2003 without opening the 2007 file?

basically what i'm looking for is to get the data excel 2007 columns b,d,e and place the data into excel 2003, columns a,b,c. then when it reaches row 65536, place the data into excel 2003 columns e,f,g



thanks
zach

Bob Phillips
01-10-2011, 11:19 AM
Public Sub ProcessData()
Dim sh As Worksheet
Dim Lastrow As Long
Dim Startcol As Long
Dim Nextrow As Long

Application.ScreenUpdating = False

Set sh = ActiveSheet

Workbooks.Add

With sh

Lastrow = .Cells(.Rows.Count, "B").End(xlUp).Row
Startcol = 1
Nextrow = 1
Do

.Cells(Nextrow, "B").Resize(65535, 1).Copy ActiveSheet.Cells(1, Startcol)
.Cells(Nextrow, "D").Resize(65535, 2).Copy ActiveSheet.Cells(1, Startcol + 1)
Nextrow = Nextrow + 65535
Startcol = Startcol + 3
Loop Until Nextrow > Lastrow
End With

Application.ScreenUpdating = True
End Sub

vzachin
01-10-2011, 06:35 PM
hi bob, i'm sorry if i didn't explain my issue a little better. i only have excel 2003. i can open the excel 2007 file but can only view 65336 rows. i was thinking that maybe i'm able to extract the data by utilizing vba to extract the data

zach

Bob Phillips
01-11-2011, 01:28 AM
Then you have a problem, as far as 2003 is concerned there are only 65535 rows. You have to manage it from 2007.

vzachin
01-11-2011, 06:13 AM
thanks bob.