Macro help with filing

  • Thread starter Stig - tame racing driver
  • Start date
S

Stig - tame racing driver

Is it possible and how do you do this:

On an excel sheet I'm going to have (see below)

Doc. Reference Doc.No Topic Orgntr Doc. Type
Created Modified

ABC 0001 123 cost dm
ppt 18/03/2009


All I want is when the topic and doc type column has been filled in. A Marco
fills in orgnt (dm) and created column (date)and also creates the document
and saves it as 123 (for eg)


Hope you can help........... thanks
 
J

JP

If Topic was in column D and Doc type was column F (per your example),
just fill this formula down in column E:

=IF(AND(NOT(ISBLANK(D2)),NOT(ISBLANK(F2))),"dm","")

Assuming row 1 is your header row. For your date, just click a cell in
column G (or whatever column you want) and press Ctrl-; (semicolon).

No macros needed.

To save your document with a given filename, here's a macro:

Sub SaveAsFile()

Dim fileN As String
fileN = Application.GetSaveAsFilename
If fileN <> False Then
ActiveWorkbook.SaveAs Filename:=fileN, FileFormat:=xlNormal
End If

End Sub

HTH,
JP
 
S

Stig - tame racing driver

Thank you

If Topic was in column D and Doc type was column F (per your example),
just fill this formula down in column E:

=IF(AND(NOT(ISBLANK(D2)),NOT(ISBLANK(F2))),"dm","")

Assuming row 1 is your header row. For your date, just click a cell in
column G (or whatever column you want) and press Ctrl-; (semicolon).

No macros needed.

To save your document with a given filename, here's a macro:

Sub SaveAsFile()

Dim fileN As String
fileN = Application.GetSaveAsFilename
If fileN <> False Then
ActiveWorkbook.SaveAs Filename:=fileN, FileFormat:=xlNormal
End If

End Sub

HTH,
JP
 

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