Thread: VBA question
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Glenn Glenn is offline
external usenet poster
 
Posts: 1
Default 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