Inserting rows from "unstable" csv
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 |
Inserting rows from "unstable" csv
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 |
Inserting rows from "unstable" csv
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 |
All times are GMT +1. The time now is 11:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com