ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with filename =Heute() (https://www.excelbanter.com/excel-programming/431069-problem-filename-%3Dheute.html)

Jamen Lone

Problem with filename =Heute()
 
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



Stefi

Problem with filename =Heute()
 
Are you sure that A2 contains the equal sign preceding HEUTE()?
Or you can use this equivalent:
AktDatum = "DATEN_" & Date & ".xls"

Regards,
Stefi


Jamen Lone ezt *rta:

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

Problem with filename =Heute()
 
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

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

Stefi

Problem with filename =Heute()
 
Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi



Dave Peterson ezt *rta:

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


Dave Peterson

Problem with filename =Heute()
 
With my USA settings, if I have my normal default date format (taken from the
windows regional settings) of mm/dd/yyyy, this filename will look like it's a
deeper path.

daten_07/14/2009.xls

I know that some use mm-dd-yyyy as their default date format and then this kind
of thing would work (if it matched that filename, of cource).



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

Dave Peterson ezt *rta:

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


--

Dave Peterson

Dave Peterson

Problem with filename =Heute()
 
ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

Dave Peterson ezt *rta:

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


--

Dave Peterson

Jamen Lone

Problem with filename =Heute()
 
Thanks a lot for your help. Now it works fine for me.

"Jamen Lone" schrieb im Newsbeitrag
...
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




Stefi

Problem with filename =Heute()
 
Yes, I'm in Europe, I use a Hungarian language version of Excel2003, my short
date windows format set to éééé.HH.nn. (that is yyyy.MM.dd.) and
AktDatum = "DATEN_" & Range("A2") & ".xls"
gave the desired result without any additional formatting or converting.

Unfortunately Jamen posted only that his problem was solved, he didn't write
what was the cause.

Regards,
Stefi

Dave Peterson ezt *rta:

ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

âžDave Peterson❠ezt Ã*rta:

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


--

Dave Peterson


Dave Peterson

Problem with filename =Heute()
 
Those slashes commonly used in USA short date settings will cause lots of
problems in filenames.



Stefi wrote:

Yes, I'm in Europe, I use a Hungarian language version of Excel2003, my short
date windows format set to éééé.HH.nn. (that is yyyy.MM.dd.) and
AktDatum = "DATEN_" & Range("A2") & ".xls"
gave the desired result without any additional formatting or converting.

Unfortunately Jamen posted only that his problem was solved, he didn't write
what was the cause.

Regards,
Stefi

Dave Peterson ezt *rta:

ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

âžDave Peterson❠ezt Ã*rta:

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


--

Dave Peterson


--

Dave Peterson

Dave Peterson

Problem with filename =Heute()
 
Ps. My windows short date is mm/dd/yyyy (4 digit year). Lots of people (most?)
use mm/dd/yy (or another format).

I wouldn't trust my code to assume that the user's short date format matched the
name of the file even if the format always contained valid characters.

Dave Peterson wrote:

Those slashes commonly used in USA short date settings will cause lots of
problems in filenames.

Stefi wrote:

Yes, I'm in Europe, I use a Hungarian language version of Excel2003, my short
date windows format set to éééé.HH.nn. (that is yyyy.MM.dd.) and
AktDatum = "DATEN_" & Range("A2") & ".xls"
gave the desired result without any additional formatting or converting.

Unfortunately Jamen posted only that his problem was solved, he didn't write
what was the cause.

Regards,
Stefi

Dave Peterson ezt *rta:

ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

âžDave Peterson❠ezt Ã*rta:

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


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Stefi

Problem with filename =Heute()
 
Fullstops (.) used with us also causes problems when used in file names
(Windows considers them as extension separator).


Dave Peterson ezt *rta:

Those slashes commonly used in USA short date settings will cause lots of
problems in filenames.



Stefi wrote:

Yes, I'm in Europe, I use a Hungarian language version of Excel2003, my short
date windows format set to éééé.HH.nn. (that is yyyy.MM.dd.) and
AktDatum = "DATEN_" & Range("A2") & ".xls"
gave the desired result without any additional formatting or converting.

Unfortunately Jamen posted only that his problem was solved, he didn't write
what was the cause.

Regards,
Stefi

âžDave Peterson❠ezt Ã*rta:

ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

ââ¬Å¾Dave Petersonââ¬Â ezt ÃÂ*rta:

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


--

Dave Peterson


--

Dave Peterson


Dave Peterson

Problem with filename =Heute()
 
Personally, I don't like filenames with spaces or more than one dot. But
Windows doesn't care.

In fact, I've given up my fight and embraced the dark side. I now use multiple
dots and spaces.

Stefi wrote:

Fullstops (.) used with us also causes problems when used in file names
(Windows considers them as extension separator).

Dave Peterson ezt *rta:

Those slashes commonly used in USA short date settings will cause lots of
problems in filenames.



Stefi wrote:

Yes, I'm in Europe, I use a Hungarian language version of Excel2003, my short
date windows format set to éééé.HH.nn. (that is yyyy.MM.dd.) and
AktDatum = "DATEN_" & Range("A2") & ".xls"
gave the desired result without any additional formatting or converting.

Unfortunately Jamen posted only that his problem was solved, he didn't write
what was the cause.

Regards,
Stefi

âžDave Peterson❠ezt Ã*rta:

ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

ââ¬Å¾Dave Petersonââ¬Â ezt ÃÂ*rta:

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


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Stefi

Problem with filename =Heute()
 
Partly agreed! I don't use spaces and multiple dots but I'am receiving files
with such names.


Dave Peterson ezt *rta:

Personally, I don't like filenames with spaces or more than one dot. But
Windows doesn't care.

In fact, I've given up my fight and embraced the dark side. I now use multiple
dots and spaces.

Stefi wrote:

Fullstops (.) used with us also causes problems when used in file names
(Windows considers them as extension separator).

âžDave Peterson❠ezt Ã*rta:

Those slashes commonly used in USA short date settings will cause lots of
problems in filenames.



Stefi wrote:

Yes, I'm in Europe, I use a Hungarian language version of Excel2003, my short
date windows format set to éééé.HH.nn. (that is yyyy.MM.dd.) and
AktDatum = "DATEN_" & Range("A2") & ".xls"
gave the desired result without any additional formatting or converting.

Unfortunately Jamen posted only that his problem was solved, he didn't write
what was the cause.

Regards,
Stefi

ââ¬Å¾Dave Petersonââ¬Â ezt ÃÂ*rta:

ps. Are you in Europe? And is your short date windows format set to dd.mm.yyyy
(or a legal filename)?



Stefi wrote:

Hi Dave,

I tried the original
AktDatum = "DATEN_" & Range("A2") & ".xls"
with =TODAY() in A2 without any own formatting and it gave the desired
result, that's why I guessed that the equal sign is missing from A2. Another
possibility if A2 is formatted like text!

Stefi

âââšÂ¬Ã¾Dave PetersonâââšÂ¬Ã ezt ÃÆÃÂ*rta:

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


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com