Results 1 to 14 of 14
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    always in txt format... (2000 sr 1)

    i take this value from a txt file with this:
    var_DATACONT = Mid(riga, 15, 10)
    and insert in the sheet with this:
    ELENCO.Range("A" & Trim(Str(CONT))).Value = var_DATACONT
    i wolud want to be sure this value is take in txt format
    Note: i have formated the column A in txt format

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    You will have to provide more information. What kind of data does var_DATACONT contain?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: always in txt format... (2000 sr 1)

    a date 15/11/2004 but i want this date in txt format...

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    Does this work?

    ELENCO.Range("A" & Trim(Str(CONT))).Value = Format(var_DATACONT, "dd/mm/yyyy")

    You can replace "dd/mm/yyyy" by your preferred date format.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: always in txt format... (2000 sr 1)

    ok!, but i dont want to insert in the column a date but a txt string therefore as it is found on the txt file

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    Sorry, I don't understand. You want to insert a date, but not a date? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: always in txt format... (2000 sr 1)

    YES, not date but simple a string of character....

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    Which result do you get now? If I format a cell as Text, then set the value of the cell in code to a string, the cell displays that string.

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: always in txt format... (2000 sr 1)

    HANS, HANS, HANS...

    I am Crazy....
    Naturally with this project L0785_DEF ..... <img src=/S/aflame.gif border=0 alt=aflame width=16 height=16> <img src=/S/bash.gif border=0 alt=bash width=35 height=39> <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

    Please download thw last version...
    http://www.gssitaly.com/l0785_def.zip
    http://www.gssitaly.com/prova.zip

    I have added a macro to import from MDB int sheet. (DA_ACCESS_A_EXCEL) for test use ta module to refer Sub IMPORTA_TOTALE() Clear all record into sheet L0785_TOTALE before th test
    All field in the MDB are formatted in txt. All column A and I are formmatted in txt mode
    But when i import from MDB into sheet the value in the column A and I not respect the format of MDB...
    15/11/2004 assuming 11/15/2004, 29/10/2004 assuming 10/29/2004. in the sheet aaaaaaaaaaaaaaaaaaaaaaaHHHHHHHHHHHHH
    Help, help, help...

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    I thought you were asking a question about importing from a text file, now you're asking about importing from a database.

    Please create cut-down copies of your database and spreadsheet, put them in one zip file and attach the zip file to a post. As I remarked last week, you can easily reduce the size of the files by omitting things that are not for this question.

  11. #11
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: always in txt format... (2000 sr 1)

    Pearphs i have solved with this:

    ELENCO.Range("A" & Trim(Str(CONT))).Value = CStr(var_DATACONT)

    is a

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    If it works for you, it is a good idea.

  13. #13
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: always in txt format... (2000 sr 1)

    For this prob i have solved... (importing & exporting in txt format) all is ok!
    But another strong and big...
    HUM... i have seen and the problem not is referd to MDB but only to the scroll bar... ACCCCC!
    My actually prob... simple during the scrollbar if i selct from the useform the button L0785_CDI_50 some value in the column are cleared... (Range column T to X)

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: always in txt format... (2000 sr 1)

    Since you started a new thread, I will lock this one. All replies to <post#=427782>post 427782</post#>, please.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •