PDA

View Full Version : Solved: write cell address in text file through vba



ilyaskazi
05-20-2005, 07:09 AM
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

xld
05-20-2005, 07:24 AM
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


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

ilyaskazi
05-20-2005, 07:31 AM
is it possible if "MYFILE.txt" is not found in activework.path, then create new and write
else if found, then open and write.

xld
05-20-2005, 07:49 AM
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.

ilyaskazi
05-26-2005, 10:32 PM
yaa... thanku,

it is working.