Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cannot read selected row
I am using Excel 2000 with sp3.
I am attempting to run code from the current workbook and open a second instance of Excel, add a new workbook, paste in data from a recordset from an Access database. All works well until I attempt to read the row for thencurrently selected cell and store to a variable. Here is my code: Set oExcel = CreateObject("Excel.Application") Set oBook = oExcel.Workbooks.Add Set oSheet = oBook.Worksheets(1) oSheet.Activate 'next line adds data from open recordset - works well oSheet.Range("A1").CopyFromRecordset myrs oSheet.Range("A1").Select oSheet.Range("A1").End(xlDown).Select 'next line reads row from last active worksheet of workbook where code 'is running from, not from the new workbook MyEnd = Selection.Row Any help is appreciated. -- HTH Mr B |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. | Excel Worksheet Functions | |||
how read value from last selected cell? It is possible? how get adress last selected cell? | New Users to Excel | |||
how read value from last selected cell? It is possible? how get adress last selected cell? | Excel Programming | |||
Can VBA read the row-col location of a selected cell? | Excel Programming |