Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default need assist with save as csv code

I have this following code
What I require is at the activeCell.SpecialCells(xlLastCell)
for it to add the next blank row to the selection.
I am having some difficulty with this.
any assistance will be greatly appreciated.
Paul

Sub SaveAsCSV()
'This macro will SAVE AS to C:\Trees folder, which must exist before
macro runs

'
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False

ActiveWorkbook.SaveAs Filename:="C:\Trees\" & "UP" & Format(Now,
"yymmddhhmm") & ".csv", FileFormat:=xlCSV, _
CreateBackup:=False
ActiveWorkbook.Close SaveChanges:=False


End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default need assist with save as csv code

Husky,

Please try this

Sub SaveAsCSV()
'This macro will SAVE AS to C:\Trees folder, which must exist before
macro runs

'
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell).Offset(1,0)).C opy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False

ActiveWorkbook.SaveAs Filename:="C:\Trees\" & "UP" & Format(Now,
"yymmddhhmm") & ".csv", FileFormat:=xlCSV, _
CreateBackup:=False
ActiveWorkbook.Close SaveChanges:=False


End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
ups.com...
I have this following code
What I require is at the activeCell.SpecialCells(xlLastCell)
for it to add the next blank row to the selection.
I am having some difficulty with this.
any assistance will be greatly appreciated.
Paul

Sub SaveAsCSV()
'This macro will SAVE AS to C:\Trees folder, which must exist before
macro runs

'
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False

ActiveWorkbook.SaveAs Filename:="C:\Trees\" & "UP" & Format(Now,
"yymmddhhmm") & ".csv", FileFormat:=xlCSV, _
CreateBackup:=False
ActiveWorkbook.Close SaveChanges:=False


End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default need assist with save as csv code

Thanks very much Bob,
Works a charm.

Cheers paul

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assist with formula Soth Excel Worksheet Functions 3 June 30th 09 05:41 AM
Please assist... soke2001 Excel Worksheet Functions 3 September 15th 07 01:59 PM
Can't remember....please assist Latina Excel Discussion (Misc queries) 4 February 8th 07 08:20 PM
Formula Assist [email protected] Excel Discussion (Misc queries) 3 June 7th 06 12:37 AM
Please assist Bubba_James Excel Worksheet Functions 1 September 9th 05 06:28 PM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"