Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing to a file from excel
Hi,
need help with the following. I have cell1 cell3 cell 4 selected then need to run a macro that will write the values of the the selected cells to a file in the following format. copy cell1.value + cell3.value + cell4 C:\docs\Bigfile.txt I have all except that I dont know how to get it written the cell value followed by a "+" then the next selected cell value...also I dont need the last cell to be followed by a + sign I will really appreciate any help.. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing to a file from excel
cell1.value & " + " & cell3.value & " + " & cell4.value
You may have to assign this to a variable before writing to the file. HTH, Greg "Cesar Zapata" wrote in message ... Hi, need help with the following. I have cell1 cell3 cell 4 selected then need to run a macro that will write the values of the the selected cells to a file in the following format. copy cell1.value + cell3.value + cell4 C:\docs\Bigfile.txt I have all except that I dont know how to get it written the cell value followed by a "+" then the next selected cell value...also I dont need the last cell to be followed by a + sign I will really appreciate any help.. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing to a file from excel
Sub Tester1()
sStr = "" For Each cell In Selection sStr = sStr & cell.Value & " + " Next sStr = Left(sStr, Len(sStr) - 3) Open "C:\docs\Bigfile.txt" For Output As #1 Print #1, sStr Close #1 End Sub -- Regards, Tom Ogilvy "Cesar Zapata" wrote in message ... Hi, need help with the following. I have cell1 cell3 cell 4 selected then need to run a macro that will write the values of the the selected cells to a file in the following format. copy cell1.value + cell3.value + cell4 C:\docs\Bigfile.txt I have all except that I dont know how to get it written the cell value followed by a "+" then the next selected cell value...also I dont need the last cell to be followed by a + sign I will really appreciate any help.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Writing to notepad file | Excel Discussion (Misc queries) | |||
writing on an excel file | New Users to Excel | |||
Writing a .txt file | Excel Programming | |||
Writing a text file from Excel using VBA ... a small issue | Excel Programming | |||
file writing | Excel Programming |