Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filename Problem | Excel Programming | |||
filename problem in VB | Excel Programming | |||
Filename problem | Excel Programming | |||
Still filename problem | Excel Programming | |||
Quote in filename causes problem with Application.Run | Excel Programming |