View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Unique filenames

Hi again,

In my example, I assumed the unique identifier is in A1 of activesheet. The
cell reference can be changed as desired. If the unique identifier is found
on another sheet, we have to use the sheet reference too:

MyFileName = "Report" & Sheets("Sheet1").Range("A1").Value & ".xls"

Regards,
Per

"Under Pressure" skrev i
meddelelsen ...
Per

Thanks for the prompt reply.

I can't try your solution until I get to work tomorrow. However, I'm not
sure from your lines of code where abouts I need to store my unique
identifier. I'm also using Excel 2003 so presumably from the comment from
Eric, I'll need to have a go with your second post.

Thanks again

Under Pressure

"Per Jessen" wrote:

Hi

See if this can help you:

MyPath = "C:\Temp\"
MyFileName = "Report" & Range("A1").Value & ".pdf"

Sheets("Report").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
MyPath & MyFileName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False,
OpenAfterPublish:=
_
False

Regards,
Per

"Under Pressure" skrev i
meddelelsen ...
Here's a tricky one (for me anyway)

I have a macro that reads a line of data from a sheet and presents it
in a
second sheet as a report. This report also contains some fixed text
and
simple graphics. The macro then prints the 'report' and goes back to
the
first sheet for the next line of data ....... and so on. There are
hundreds
of rows in the sheet and therefore hundreds of printed reports.

OK so far?

What I would like to do is to save each of the 'reports' using a unique
reference taken from one of the cells in the row that has been copied
onto
the report.

Any ideas?

As an addition, it would be preferable to save the report in a PDF
format.

Thanks in anticipation.

Under Pressure