Updating cells from an external file

bromberg

Board Regular
Joined
Nov 7, 2005
Messages
82
How can I update cells in EXCEL from an external file containing data that I just downloaded into a text file. For example, I want record 1 of my file to update the contents of cell A30, record 2 of the file to update cell B30, etc...
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi Danny,
Welcome to the board !

Code:
Sub Update()
f = FreeFile
ColNr = 1
Open "c:\data\test.txt" For Input As #1
Do While Not EOF(f)
    Line Input #f, t
    Cells(30, ColNr) = t
    ColNr = ColNr + 1
Loop
Close #f
End Sub
Where "c:\data\test.txt" is the file with your data...
 
Upvote 0

Forum statistics

Threads
1,222,441
Messages
6,166,049
Members
452,009
Latest member
oishi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top