Hi,
I have an excel spreadsheet with a few columns. I have added a column called modification date and I would like to compare it with a column card num and if there is data in card num then I want the modification date column to add the current date.
How do I do this. Please advice?
Hi,
Thank you for your comments. I did make the changes to the script but it doesn't do anything to my spreadsheet. Please advice.
Sub mymacro1()
'
' mymacro1 Macro
' Macro recorded
'
'
const xlDown=&HFFFFEFE7
Set objXL = CreateObject("Excel.Application")
objXL.visible=true
Set objWB = objXL.WorkBooks.Open("C:\data\abc.csv")
Set objWS = objXL.ActiveWorkBook.WorkSheets("abc")
With objWS
.Rows("1:1").Insert
.Application.Selection.End(xlDown).Select()
.Range("A1").Value = "First Name"
.Range("B1").Value = "Middel int"
.Range("C1").value = "Last name"
.Range("D1").value = "Start Date"
.Range("E1").value = "Card Num"
.Range("F1").value = "Modification Date"
end with
int iRow = 2
objXL.DisplayAlerts=false
objWB.save
objWB.Close
objXL.Quit
End Sub
I have an excel spreadsheet with a few columns. I have added a column called modification date and I would like to compare it with a column card num and if there is data in card num then I want the modification date column to add the current date.
How do I do this. Please advice?
Hi,
Thank you for your comments. I did make the changes to the script but it doesn't do anything to my spreadsheet. Please advice.
Sub mymacro1()
'
' mymacro1 Macro
' Macro recorded
'
'
const xlDown=&HFFFFEFE7
Set objXL = CreateObject("Excel.Application")
objXL.visible=true
Set objWB = objXL.WorkBooks.Open("C:\data\abc.csv")
Set objWS = objXL.ActiveWorkBook.WorkSheets("abc")
With objWS
.Rows("1:1").Insert
.Application.Selection.End(xlDown).Select()
.Range("A1").Value = "First Name"
.Range("B1").Value = "Middel int"
.Range("C1").value = "Last name"
.Range("D1").value = "Start Date"
.Range("E1").value = "Card Num"
.Range("F1").value = "Modification Date"
end with
int iRow = 2
objXL.DisplayAlerts=false
objWB.save
objWB.Close
objXL.Quit
End Sub