Inserting rows from "unstable" csv

R

Renster

Folks,

I have the function below, which imports values from a column in a csv
that is generated elsewhere, and places the values in an empty row in
my spreadsheet. However, as it stands, when the column in the CSV is
updated with the next set of results, ALL generated rows are updated
with the latest values. What I need the function to do is to insert a
"snapshot" of the csv at that moment - ie, when the CSV changes,
previous rows in the xls are unaffected. Any clues?

Thanks

Steve

=======CODE=========

Sub LatestRun()
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop

ActiveCell.FormulaR1C1 = "=today()"
For x = 2 To 17
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = "='C:\[rip-perform.csv]rip-perform'!$C$" & x
'ActiveCell.FormulaR16C1 = "='rip-perform.csv'!R2C1:R2C17"
Next
End Sub
 
R

Renster

Renster wrote:


*** Rubbish mostly, that is now snipped ***

No matter folks, I cracked it myself. Revised Function:

Sub LatestRun()
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop

ActiveCell.FormulaR1C1 = "=today()"
For x = 2 To 17
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = "='C:\[rip-perform.csv]rip-perform'!$C$" & x
ActiveCell.Copy
ActiveCell.PasteSpecial (xlPasteValues)
Next
End Sub
 
R

Renster

Renster wrote:


*** Rubbish mostly, that is now snipped ***

No matter folks, I cracked it myself. Revised Function:

Sub LatestRun()
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop

ActiveCell.FormulaR1C1 = "=today()"
For x = 2 To 17
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = "='C:\[rip-perform.csv]rip-perform'!$C$" & x
ActiveCell.Copy
ActiveCell.PasteSpecial (xlPasteValues)
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top