![]() |
VBA question
I am trying to insert a row at a specific range.
I can get this to work if I manualy enter data into a worksheet. Where it does not work is when I use VBA in Access and export the data into Excel at specific ranges. Any reason why I am not able to insert a row where I tell when the data is exported from Access? Here is my code to insert a row. Private Sub CommandButton1_Click() Dim lngValue As Long Range("A1").Select 'active cell at column heading FISC lngValue = 0 Do While lngValue <= 700 ActiveCell.Offset(1, 0).Select lngValue = ActiveCell.Value Loop 'activecell is now on the first row where value is bigger than 700 ActiveCell.EntireRow.Insert End Sub |
VBA question
Any chance you are using Access 97?
Apparently the created Excel file is not Excel97 and needs to be saved first as 97 before it will behave the way you expect. -----Original Message----- I am trying to insert a row at a specific range. I can get this to work if I manualy enter data into a worksheet. Where it does not work is when I use VBA in Access and export the data into Excel at specific ranges. Any reason why I am not able to insert a row where I tell when the data is exported from Access? Here is my code to insert a row. Private Sub CommandButton1_Click() Dim lngValue As Long Range("A1").Select 'active cell at column heading FISC lngValue = 0 Do While lngValue <= 700 ActiveCell.Offset(1, 0).Select lngValue = ActiveCell.Value Loop 'activecell is now on the first row where value is bigger than 700 ActiveCell.EntireRow.Insert End Sub . |
All times are GMT +1. The time now is 07:18 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com