Consulting

Results 1 to 5 of 5

Thread: Solved: write cell address in text file through vba

  1. #1

    Arrow Solved: write cell address in text file through vba

    a3 of the activeSheet is my cell address.

    open notepad file = "Locate.txt"

    after the last line of text in above said file, write...

    activesheet.name (SHEET1), then 1 TAB required and then cell address (a3).

    For eg:

    SHEET1 A3

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by ilyaskazi
    a3 of the activeSheet is my cell address.

    open notepad file = "Locate.txt"

    after the last line of text in above said file, write...

    activesheet.name (SHEET1), then 1 TAB required and then cell address (a3).

    For eg:

    SHEET1 A3
    [VBA]
    Open ActiveWorkbook.Path & "\MYFILE.txt" For Append As #1
    Print #1, ActiveSheet.Name & vbTab & ActiveCell.Address(False, False)
    Close #1
    [/VBA]

  3. #3
    is it possible if "MYFILE.txt" is not found in activework.path, then create new and write
    else if found, then open and write.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by ilyaskazi
    is it possible if "MYFILE.txt" is not found in activework.path, then create new and write
    else if found, then open and write.
    That is the default action, i.e. it already works that way.

  5. #5
    yaa... thanku,

    it is working.

Posting Permissions

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