View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Problem with filename =Heute()

ps. If the value in the cell were formatted the way you like, you could use:

AktDatum = "DATEN_" & format(Range("A2").Text, "dd.mm.yyyy") & ".xls"

Dave Peterson wrote:

Make sure you format that value (either the formula or Stefi's suggestion of
VBA's built in Date) the way you need:

AktDatum = "DATEN_" & format(Range("A2").value, "dd.mm.yyyy") & ".xls"
or
AktDatum = "DATEN_" & format(date, "dd.mm.yyyy") & ".xls"

Jamen Lone wrote:

Hi,
I've got a problem by define a filename like this ...

code...

Sub myImport()
Dim myDat As String
Dim dieseDatei As String
Dim neueTabelle As String
Dim AktDatum As String

'Namen festlegen
dieseDatei = ActiveWorkbook.Name
myDat = Range("A1")
AktDatum = "DATEN_" & Range("A2") & ".xls" 'A2 is =Heute() in german
excel

... and so on

The result is that "AktDatum" give me the following value ...
DATEN_Heute().xls and I want to have
DATEN_14.07.2009.xls

Can someone help me?

--

Jamen


--

Dave Peterson


--

Dave Peterson