I want to copy the value of cell A1 into column F for each record that exists in Sheet1. I have found some code that allows me to open the workbook I want:
I also will want to delete row 1 once the copy is complete. Can anyone point me in the right direction? Thanks.
Code:
Option Explicit
Const vbNormal = 1 ' window style
DIM objXL, objWb, objR, objTab ' Excel object variables
DIM Text, tmp, i, j, file, name
' here you may set the name of the file to be imported
file = "foo.txt" ' must be located in the script folder
' create an Excel object reference
Set objXL = WScript.CreateObject ("Excel.Application")
' set the Excel window properties (not absolutely necessary)
objXL.WindowState = vbNormal ' Normal
objXL.Visible = true ' do not show window
' Create new Workbook (needed for import the CSV file=
Set objWb = objXl.WorkBooks.Add
' Get the first loaded worksheet object of the current workbook
Set objWb = objXL.ActiveWorkBook.WorkSheets(1)
I also will want to delete row 1 once the copy is complete. Can anyone point me in the right direction? Thanks.