VBA Macro to read text file and assign values to lines

Brazeyman

New Member
Joined
Feb 21, 2018
Messages
1
Hi all,

I am hoping someone can help me make my excel spreadsheet read a text file line by line and assign variables to those lines so they can be referenced further down the marco to hyperlink.

First I would like the macro to read a .txt file line by line and give say line 1 = certain text and line 2 = certain text

following this I would like to being able to hyperlink using those values where I can assign the values

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"C:$line1$line2", TextToDisplay:="$line2.csv"
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,216,116
Messages
6,128,929
Members
449,479
Latest member
nana abanyin

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