reggie55555
MIS
I think this is a simple one but I can't get the syntax correct. I need to find the first blank row in excel and input some data.
I can do this in VB but can't quite tweak it to work with Extra. Any suggestions?
Here is my macro, I want to go to the first blank row instead of "A1"
I can do this in VB but can't quite tweak it to work with Extra. Any suggestions?
Here is my macro, I want to go to the first blank row instead of "A1"
Code:
Sub Main
Dim objxl as Object, wb As Object
Dim sUserName As String, stime
sUserName = UCase$(Environ$("username"))
Set objxl = CreateObject("Excel.Application")
stime = Format (cVar(Time), "hh:mm:ss")
With objxl
Set wb = .Workbooks.Open ("C:\Documents and Settings\" + sUsername + "\Desktop\test214.xls")
With wb.Sheets(1)
.Range("a1").Value = sUsername+", "+Date+", "+stime+", Macro Name"
'.PrintOut 1, True 'send to printer
End With
wb.Close True
Set wb = Nothing
.Quit
End With
Set objXL = Nothing
End Sub