Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help With Pulling Multi-Cell Value and Performing SaveAs 1

Status
Not open for further replies.

DrMingle

Technical User
May 24, 2009
116
US
I need to create a macro for saving three values from the active worksheet for the file name.

Below is the current code which pulls only one value (however I need three):

SaveAsNameDateScore ()
ThisFile = Range (“C18”).Value
ActiveWorkbook.SaveAs FileName:=ThisFile
EndSub

I would like to have the file name reflect the values from cell B5, B2, and C18 together.
 
Like this ?
ThisFile = Range ("B5").Value & Range ("B2").Value & Range ("C18").Value

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Well that certainly does work...Thanks.

I do have two other issues that relate to this code:

Sub SaveAsNameDateScore()
ThisFile = Range("B5").Value & Range("B2").Value & Range("C18").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

"B5" is a date 05/24/09 - I can't save with "/"
"C18" is a percentage 89% - "%" shows up as 0.89.

I would like "B5" to show up as 05-24-09 and "C18" as 89%.

Can anyone help with this?
 
ThisFile = Replace(Range("B5").Text, "/", "-") & Range("B2").Text & Range("C18").Text

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top