Guest Phillip R Posted March 12, 2008 Posted March 12, 2008 I'm having issues exporting a range from excel to file, I don't want to copy the entire spreadsheet or a whole row just a range. I tried this Print #FileNum, ( Range("2:1,10:2").Select) Another question is do iterate through the cells Dim firstcell as string Dim lastcell as string Dim MyRow as string for firstcell = A2 to lastcell If Range(firstcell).value <> "" Myrow =(firstcell, lastcell) Print # FileNum, (Range(firstCell, lastcell) End if Next firstcell
Guest Pegasus \(MVP\) Posted March 12, 2008 Posted March 12, 2008 Re: Need help with excel and VB "Phillip R" <phillip@philliprosenbaum.com> wrote in message news:62535DFF-5B2C-4F48-806F-4102F636AEDE@microsoft.com... > I'm having issues exporting a range from excel to file, I don't want to > copy > the entire spreadsheet or a whole row just a range. > > I tried this Print #FileNum, ( Range("2:1,10:2").Select) > > Another question is do iterate through the cells > Dim firstcell as string > Dim lastcell as string > Dim MyRow as string > for firstcell = A2 to lastcell > If Range(firstcell).value <> "" > Myrow =(firstcell, lastcell) > Print # FileNum, (Range(firstCell, lastcell) > End if > Next firstcell > I would try posting in a scripting newsgroup.
Recommended Posts