Save file with cell name

  • Thread starter Brian Thompson via OfficeKB.com
  • Start date
B

Brian Thompson via OfficeKB.com

Hi
In cell A1 i have =cell"filename"A1 giving me the
I want to run macro that will save new file with data in A1

Example. tab named wc0701. new file saved as wc0701


Any idea's

regards
 
D

Dave Peterson

You could just drop the formula in A1 and use the worksheet name itself.

with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
end with
 
B

Brian Thompson via OfficeKB.com

Hi Dave
Sorry not understand
The workbook is saved as "name"
each week one tab will be formatted and then saved as the "tab name" of in my
case as cell A1 owing to the formula in A1
I,m not fully ofay with VBA, however, can edit the existing macro with the
correct lines

Hope this makes sence

brian

Dave said:
You could just drop the formula in A1 and use the worksheet name itself.

with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
end with
Hi
In cell A1 i have =cell"filename"A1 giving me the
[quoted text clipped - 5 lines]
 
D

Dave Peterson

with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
end with

The dots in front of .parent and .name refer to the object in the previous with
statement. In this case, they refer to the active sheet.

So this says to use the activesheet and save the parent (the workbook that
contains that activesheet) to the C:\ folder as the name of that active sheet
(.name still refers to the activesheet).

If you tried this and got your file saved as "NAME", then I'd bet you didn't
copy|paste correctly (or changed somet stuff after).

The formula:
=cell("Filename",a1)
returns the name of the worksheet that holds the formula.

But that name can be obtained directly from the worksheet name itself.

Brian Thompson via OfficeKB.com said:
Hi Dave
Sorry not understand
The workbook is saved as "name"
each week one tab will be formatted and then saved as the "tab name" of in my
case as cell A1 owing to the formula in A1
I,m not fully ofay with VBA, however, can edit the existing macro with the
correct lines

Hope this makes sence

brian

Dave said:
You could just drop the formula in A1 and use the worksheet name itself.

with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
end with
Hi
In cell A1 i have =cell"filename"A1 giving me the
[quoted text clipped - 5 lines]
 
B

Brian Thompson via OfficeKB.com

Hi
I am not sure, hope this explains
Workbook saved as Yard Summary
52 shhets in workbook, one for each week
Weekly i update one sheet and copy sheet, then paste special to new sheet ,
format, and "save as "new sheet as per the tab name
Incidentaly, I do have the cell A1 in each sheet =Cell("filename",A1) giving
the tab name in the sheet
Q. Is macro for the "save as" section possible?

regards



Dave said:
with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
end with

The dots in front of .parent and .name refer to the object in the previous with
statement. In this case, they refer to the active sheet.

So this says to use the activesheet and save the parent (the workbook that
contains that activesheet) to the C:\ folder as the name of that active sheet
(.name still refers to the activesheet).

If you tried this and got your file saved as "NAME", then I'd bet you didn't
copy|paste correctly (or changed somet stuff after).

The formula:
=cell("Filename",a1)
returns the name of the worksheet that holds the formula.

But that name can be obtained directly from the worksheet name itself.
Hi Dave
Sorry not understand
[quoted text clipped - 19 lines]
 
D

Dave Peterson

I would have thought that last suggestion would have done it for you.

Brian Thompson via OfficeKB.com said:
Hi
I am not sure, hope this explains
Workbook saved as Yard Summary
52 shhets in workbook, one for each week
Weekly i update one sheet and copy sheet, then paste special to new sheet ,
format, and "save as "new sheet as per the tab name
Incidentaly, I do have the cell A1 in each sheet =Cell("filename",A1) giving
the tab name in the sheet
Q. Is macro for the "save as" section possible?

regards

Dave said:
with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
end with

The dots in front of .parent and .name refer to the object in the previous with
statement. In this case, they refer to the active sheet.

So this says to use the activesheet and save the parent (the workbook that
contains that activesheet) to the C:\ folder as the name of that active sheet
(.name still refers to the activesheet).

If you tried this and got your file saved as "NAME", then I'd bet you didn't
copy|paste correctly (or changed somet stuff after).

The formula:
=cell("Filename",a1)
returns the name of the worksheet that holds the formula.

But that name can be obtained directly from the worksheet name itself.
Hi Dave
Sorry not understand
[quoted text clipped - 19 lines]
 
B

Brian Thompson via OfficeKB.com

not knowledgable enough with command line
got error with below
..parent.saveas filename:=c:/&.week1&".xls



rian said:
Hi
I am not sure, hope this explains
Workbook saved as Yard Summary
52 shhets in workbook, one for each week
Weekly i update one sheet and copy sheet, then paste special to new sheet ,
format, and "save as "new sheet as per the tab name
Incidentaly, I do have the cell A1 in each sheet =Cell("filename",A1) giving
the tab name in the sheet
Q. Is macro for the "save as" section possible?

regards
with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
[quoted text clipped - 21 lines]
 
D

Dave Peterson

What's week1?

Maybe:

..parent.saveas filename:="c:\" & week1 &".xls
or
..parent.saveas filename:="c:\week1.xls"

What happened to using the name of the worksheet?


Brian Thompson via OfficeKB.com said:
not knowledgable enough with command line
got error with below
.parent.saveas filename:=c:/&.week1&".xls

rian said:
Hi
I am not sure, hope this explains
Workbook saved as Yard Summary
52 shhets in workbook, one for each week
Weekly i update one sheet and copy sheet, then paste special to new sheet ,
format, and "save as "new sheet as per the tab name
Incidentaly, I do have the cell A1 in each sheet =Cell("filename",A1) giving
the tab name in the sheet
Q. Is macro for the "save as" section possible?

regards
with activesheet
.parent.saveas filename:="C:\" & .name & ".xls", ...rest of options
[quoted text clipped - 21 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top