Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andy
 
Posts: n/a
Default This one is tricky....Macro to save file as cell value x in di

Thankyou very much for your help this worked well...

"JE McGimpsey" wrote:

This is rather an FAQ if you look in the archives:

http://groups.google.com/advanced_gr...=group:*excel*

One way:

Public Sub SaveInB2AsA2()
Const sPATH As String = "R:/SALES/Team 318/"
ThisWorkbook.SaveAs _
Filename:=sPATH & Range("B2").Text & _
Application.PathSeparator & Range("A2").Text & ".xls"
End Sub



In article ,
"Andy" wrote:

Two cells A1 & B2

I am trying to create a Macro to attach to a button to Save an .xls as

"A1".xls in directory R:/SALES/Team 318/"B2"

instead of typing it in all of the time....

Any helpers? Past attempts at this have failed.....the winner will get a big
MVP vote!


  #2   Report Post  
Andy
 
Posts: n/a
Default

Thanks Jason. There was a bug in this that I couldnt work out. Thanks for
your help though. The next three worked....

"Jason Morin" wrote:

Try something like:

Sub Test()
Dim mypath As String
Dim sfile As Range, sdir As Range

mypath = "R:\SALES\Team 318\"
Set sfile = Sheets("Sheet1").Range("A1")
Set sdir = Sheets("Sheet1").Range("B2")

ThisWorkbook.SaveAs Filename:=mypath & sdir & "\" & sfile

End Sub

---
HTH
Jason
Atlanta, GA

-----Original Message-----
Hi

Two cells A1 & B2

I am trying to create a Macro to attach to a button to

Save an .xls as

"A1".xls in directory R:/SALES/Team 318/"B2"

instead of typing it in all of the time....

Any helpers? Past attempts at this have failed.....the

winner will get a big
MVP vote!

Absolute respect

Andy

.


  #3   Report Post  
Andy
 
Posts: n/a
Default

thanks for this. It worked.

"tjtjjtjt" wrote:

Andy,
I just copied the filepath from your post--
As the other posts show, if you are on a Windows machine, the slashes from
your filepath are going the wrong way.

tj

"tjtjjtjt" wrote:

How about something like this:

Sub SvFile()

ActiveWorkbook.SaveAs Filename:= _
"R:/SALES/Team 318" & Range("B1").Value _
& "\" & Range("A1").Value & ".xls"

End Sub

tj

"Andy" wrote:

Hi

Two cells A1 & B2

I am trying to create a Macro to attach to a button to Save an .xls as

"A1".xls in directory R:/SALES/Team 318/"B2"

instead of typing it in all of the time....

Any helpers? Past attempts at this have failed.....the winner will get a big
MVP vote!

Absolute respect

Andy

  #4   Report Post  
Andy
 
Posts: n/a
Default

Thanks Bob.....this did the trick as it was the least code for the three
responses. I appreciate your help. Youre not from Brisbane?

"Bob Phillips" wrote:

ActiveWorkbook.SaveAs Filename:= "R:\SALES\Team 318\" & Range("B1").Value &
"\" & Range("A1").Value & ".xls"

--

HTH

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


"Andy" wrote in message
...
Hi

Two cells A1 & B2

I am trying to create a Macro to attach to a button to Save an .xls as

"A1".xls in directory R:/SALES/Team 318/"B2"

instead of typing it in all of the time....

Any helpers? Past attempts at this have failed.....the winner will get a

big
MVP vote!

Absolute respect

Andy




  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Not quite, South Coast of England.

--

HTH

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


"Andy" wrote in message
...
Thanks Bob.....this did the trick as it was the least code for the three
responses. I appreciate your help. Youre not from Brisbane?

"Bob Phillips" wrote:

ActiveWorkbook.SaveAs Filename:= "R:\SALES\Team 318\" &

Range("B1").Value &
"\" & Range("A1").Value & ".xls"

--

HTH

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


"Andy" wrote in message
...
Hi

Two cells A1 & B2

I am trying to create a Macro to attach to a button to Save an .xls as

"A1".xls in directory R:/SALES/Team 318/"B2"

instead of typing it in all of the time....

Any helpers? Past attempts at this have failed.....the winner will get

a
big
MVP vote!

Absolute respect

Andy






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
Embedding file name in a Cell Mark Sowerbutts Links and Linking in Excel 2 January 5th 05 04:32 PM
File asks to update when no links were created Dave Links and Linking in Excel 1 December 16th 04 09:10 PM


All times are GMT +1. The time now is 04:37 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"