Editing imported data

rbsam

New Member
Joined
Jul 12, 2019
Messages
42
First, I should point out I'm using Excel for Mac.

So I've gone to File, Import, CSV file, selected the file and it has imported successfully on my spreadsheet. I've also got a Macro set up so every few seconds it checks for updates and refreshes the imported data.

I'm trying to make it so if any cell in column F is changed on the spreadsheet then these changes are reflected on the CSV file that was imported. So it's a kind of 2 way street, if you change the CSV file it will be changed in the spreadsheet and if you change it on the spreadsheet it will change on the CSV file.

Is there only way to do this to use VBA to overwrite the CSV file with the amended spreadsheet data?

I found this code which I used which allowed me to write a new CSV

Code:
[FONT=Helvetica]Dim My_filenumber As Integer[/FONT]
[FONT=Helvetica]Dim logSTR As String[/FONT]
[FONT=Helvetica]
[/FONT]
[FONT=Helvetica]My_filenumber = FreeFile[/FONT]
[FONT=Helvetica]
[/FONT]
[FONT=Helvetica]logSTR = logSTR & Cells(1, "A").Value & " , "[/FONT]
[FONT=Helvetica]logSTR = logSTR & Cells(2, "A").Value & " , "[/FONT]
[FONT=Helvetica]logSTR = logSTR & Cells(3, "A").Value & " , "[/FONT]
[FONT=Helvetica]logSTR = logSTR & Cells(4, "A").Value & vbCr[/FONT]
[FONT=Helvetica]logSTR = logSTR & Cells(3, "A").Value[/FONT]
[FONT=Helvetica]
[/FONT]
[FONT=Helvetica]
[/FONT]
[FONT=Helvetica]
[/FONT]
[FONT=Helvetica]Open "/Users/samb/Documents\test.csv" For Append As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=My_filenumber]#My_filenumber[/URL] [/FONT]
[FONT=Helvetica]    Print [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=My_filenumber]#My_filenumber[/URL] , logSTR[/FONT]
[FONT=Helvetica]Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=My_filenumber]#My_filenumber[/URL] [/FONT]
[FONT=Helvetica]
[/FONT]
[FONT=Helvetica]End Sub

But I can't seem to figure out how to set a range so it works from A6 to J & EndRow... right now it's just specifying each column and row individually

Would appreciate any help anyone can give! Thanks[/FONT]
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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