VBA question

G

Glenn

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
 
B

bruce

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top