![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Scotland
Posts: 341
|
What about Getting a value from the worksheet say "10", then saving the file as "Filename10.xls" I don't know how to get a value from a worksheet (even if it's named) to the VB editor screen for use in there..... Even how to use functions, like random generators in VB
Who can help Share the Knowledge [ This Message was edited by: Ampleford on 2002-03-28 00:21 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 82
|
Hello! Are you from UK? you know Ampleforth College in York? I wonder if your nick name comes from it
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Scotland
Posts: 341
|
No - It comes from my surname.
Although I do know about the College |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
Hi,
All you need to do is split up the path/filename in the save as with & and add in either your variable, or your range. i.e. ActiveWorkbook.SaveAs Filename:="C:TESTFilename" & myVariable & ".xls", FileFormat:=xlNormal ActiveWorkbook.SaveAs Filename:="C:TESTFilename" & Range("A1").value & ".xls", FileFormat:=xlNormal Oh, and just to add, to get a value from a worksheet into a variable, you'd have something like Dim myVariable As (whatever it is) At the top of the macro Then myVariable = Range("A1").Value etc.etc. [ This Message was edited by: AJ on 2002-03-28 04:35 ] |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Scotland
Posts: 341
|
Thanks a lot - two really helpful hints there.
Cheers |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|