Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
At the end of my vb code I would like the worksheet to be saved giving it the name of 2 cell refs 1st cell ref J3 which holds a date ie 15 March 2007 2nd cell ref U3 which holds a game number so example J3 = 15 MARCH 2007 , U3 = GAME 4 save worksheet name as 15MARCH2007GAME4 any ideas ? thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
you could try adding the cells refs to a string then use that as your saveas name. Option Explicit Dim fName As String Private Sub CommandButton1_Click() fName = [j3] & [u3] ActiveWorkbook.SaveAs Filename:=fName End Sub hope this is of some help S |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry i just read your message again and think you were wanting to
rename the sheet which in that case you could use Option Explicit Dim fName As String Private Sub CommandButton1_Click() fName = [j3] & [u3] ActiveSheet.Name = fName ActiveWorkbook.Save End Sub S |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks 'Incidental' I will try that later
"Incidental" wrote: Sorry i just read your message again and think you were wanting to rename the sheet which in that case you could use Option Explicit Dim fName As String Private Sub CommandButton1_Click() fName = [j3] & [u3] ActiveSheet.Name = fName ActiveWorkbook.Save End Sub S |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim s as String
s = Replace(range("J3").Text," ","") s = s & Range("U3").Text Activesheet.Parent.SaveAs "C:\MyFolder\" & s & ".xls" -- Regards, Tom Ogilvy "Anthony" wrote: Hi, At the end of my vb code I would like the worksheet to be saved giving it the name of 2 cell refs 1st cell ref J3 which holds a date ie 15 March 2007 2nd cell ref U3 which holds a game number so example J3 = 15 MARCH 2007 , U3 = GAME 4 save worksheet name as 15MARCH2007GAME4 any ideas ? thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom, I'll give that a go later this evening at home
"Tom Ogilvy" wrote: Dim s as String s = Replace(range("J3").Text," ","") s = s & Range("U3").Text Activesheet.Parent.SaveAs "C:\MyFolder\" & s & ".xls" -- Regards, Tom Ogilvy "Anthony" wrote: Hi, At the end of my vb code I would like the worksheet to be saved giving it the name of 2 cell refs 1st cell ref J3 which holds a date ie 15 March 2007 2nd cell ref U3 which holds a game number so example J3 = 15 MARCH 2007 , U3 = GAME 4 save worksheet name as 15MARCH2007GAME4 any ideas ? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save Excel Worksheet As CSV - No Save As Dialog | Excel Programming | |||
Problem: vba code for creating a button to save worksheet as Cell | Excel Programming | |||
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: | Excel Programming | |||
Placing a code before Save & Save As | Excel Programming | |||
Worksheet Buttons (Save, Save As, Cut, Paste, etc.) Not Working | Excel Worksheet Functions |