macro problem

G

Gerbatin

I have the followig macro installed in personal.xlm:

Keyboard Shortcut: Ctrl+Shift+N
'
Sheets("ltp01027").Select
Sheets("ltp01027").Name = "matriz2"
Range("C5").Select
ChDir "C:\Office 97\Internet"
ActiveWorkbook.SaveAs Filename:="C:\Offic
97\Internet\matriz2.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

As I download it dayly, ltp01027 worksheet changes as the date of th
day; how can I edit the macro in order to recognize the new date?

TIA for any suggestion
 
D

Dave Peterson

I'm not sure if this'll work, but it looks like ltp01027 is ltp0mmdd.

If that's true:

Keyboard Shortcut: Ctrl+Shift+N

dim myName as string
myname = "LTP0" & format(date,"mmdd")
'
Sheets(myname).Select
Sheets(myname).Name = "matriz2"


Range("C5").Select
ChDir "C:\Office 97\Internet"
ActiveWorkbook.SaveAs Filename:="C:\Office
97\Internet\matriz2.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

That was the only thing that looked close to a date to me.
 

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

Similar Threads


Top