Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all, I have a script that goes out and searches a spreadsheet for
information. If it finds a null value or errors out, I need my script to open up another logging spreadsheet and look into the last cell of Column A, read what the value is and insert the same value plus 1 (Column A is and ID #) and then enter the error text into column B. I have scripted inserted columns, values into cells and such, but I have no idea how to go about finding the last cell, adding 1 to it in the next row, then adding text to the new row column B. '~~~~My script that needs help - Not all of script~~~~~~~~~~ objExcel = CreateObject("Excel.Application") objExcel.Workbooks.Open ("C:\Excelfilename.xls") Set objSheet = objExcel.ActiveWorkbook.WorkSheets(1) IntRow = 9 A = 1 K = 11 R = 18 if objExcel.Cells(intRow, K).Value < "VALIDTEXT" then objExcel.Cells(intRow, R).Interior.ColorIndex = 4 else objExcel.Visible = False objExcel.Workbooks.Open("C:\ErrorLog.xls") objExcel.Cells(A,FIRSTOPENCELL) = (LASTUSEDCELL+1) <=THIS IS WHERE I NEED HELP= objExcel.Cells(B,FIRSTOPENCELL) = "ERRORTEXT" End If So basically, I'm opening a spreadsheet, looking in Column A for the last value, adding 1 to that value and entering that on the next available row, then on that same open row, I want to also place a text value in Column B) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Wish to add a WORKSHEET but 'WORKSHEET' not open in 'INSERT' | Excel Worksheet Functions | |||
Delete Insert Worksheet on Open/Reset on Close | Excel Programming | |||
Save and Close all Open Workbooks using VBScript | Excel Programming | |||
Catching an Open Excel File with VBScript | Excel Programming | |||
open Excel workbook using vbscript | Excel Programming |