#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA saving

I want to create a macro to save a document as a number i use for a cell reference (ie cell B2 = 18112 so i want the document to be called 18112.xls) Also i have a folder with this reference to start with can excel be programed to find this folder and use it to save in

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA saving

Chris,

If the folder name is in B1 and the file name is in B2, use code
like

ThisWorkbook.SaveAs filename:=Range("B1").Value & "\" _
Range("B2").Value & ".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Chris" wrote in message
...
I want to create a macro to save a document as a number i use

for a cell reference (ie cell B2 = 18112 so i want the document
to be called 18112.xls) Also i have a folder with this reference
to start with can excel be programed to find this folder and use
it to save in.

Cheers



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default VBA saving

Public Sub save1(

ThisWorkbook.SaveAs filename:=Range("B1").Value & "\"
Range("B2").Value & ".xls
End Su

whats wrong with this. i cant figure it out. bit of a novice you se

----- Chip Pearson wrote: ----

Chris

If the folder name is in B1 and the file name is in B2, use cod
lik

ThisWorkbook.SaveAs filename:=Range("B1").Value & "\"
Range("B2").Value & ".xls


--
Cordially
Chip Pearso
Microsoft MVP - Exce
Pearson Software Consulting, LL
www.cpearson.co


"Chris" wrote in messag
..
I want to create a macro to save a document as a number i us

for a cell reference (ie cell B2 = 18112 so i want the documen
to be called 18112.xls) Also i have a folder with this referenc
to start with can excel be programed to find this folder and us
it to save in
Cheer




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default VBA saving

Hi Chris,

You are missing an ampersand before the linebreak character, try:

ThisWorkbook.SaveAs filename:=Range("B1").Value & "\" & _
Range("B2").Value & ".xls"


---
Regards,
Norman


"Chris" wrote in message
...
Public Sub save1()


ThisWorkbook.SaveAs filename:=Range("B1").Value & "\" _
Range("B2").Value & ".xls"
End Sub

whats wrong with this. i cant figure it out. bit of a novice you see

----- Chip Pearson wrote: -----

Chris,

If the folder name is in B1 and the file name is in B2, use code
like

ThisWorkbook.SaveAs filename:=Range("B1").Value & "\" _
Range("B2").Value & ".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Chris" wrote in message
...
I want to create a macro to save a document as a number i use

for a cell reference (ie cell B2 = 18112 so i want the document
to be called 18112.xls) Also i have a folder with this reference
to start with can excel be programed to find this folder and use
it to save in.
Cheers






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA saving

Cheers for that norma

now it has worked but how do i specify where to save it in the code i need it to save on "\\MARLOWESERVER\Contracts\Contracts on Second Drive"but within this is a folder called 16100-16199 or 16200-16299 etc then in there will be the folder 16170 for example. can excell be programmed to save 16170.xlsin the appropriate folder



----- Norman Jones wrote: ----

Hi Chris

You are missing an ampersand before the linebreak character, try

ThisWorkbook.SaveAs filename:=Range("B1").Value & "\" &
Range("B2").Value & ".xls


--
Regards
Norma


"Chris" wrote in messag
..
Public Sub save1(
ThisWorkbook.SaveAs filename:=Range("B1").Value & "\"

Range("B2").Value & ".xls
End Su
whats wrong with this. i cant figure it out. bit of a novice you se
----- Chip Pearson wrote: ----
Chris
If the folder name is in B1 and the file name is in B2, use cod

lik
ThisWorkbook.SaveAs filename:=Range("B1").Value & "\"

Range("B2").Value & ".xls
--

Cordially
Chip Pearso
Microsoft MVP - Exce
Pearson Software Consulting, LL
www.cpearson.co
"Chris" wrote in messag

..
I want to create a macro to save a document as a number i us

for a cell reference (ie cell B2 = 18112 so i want the documen
to be called 18112.xls) Also i have a folder with this referenc
to start with can excel be programed to find this folder and us
it to save in
Cheer

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
Automaticly saving formula's to values when saving Gunti Excel Discussion (Misc queries) 8 November 11th 08 09:34 AM
Saving Gazza at emaths Excel Discussion (Misc queries) 1 May 4th 06 12:33 AM
Saving gregory.barrett Excel Discussion (Misc queries) 0 March 13th 06 09:29 PM
Saving Changes blatham Excel Discussion (Misc queries) 4 February 3rd 06 03:17 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM


All times are GMT +1. The time now is 08:05 PM.

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"