Thread: InsertFirst
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
steve_doc steve_doc is offline
external usenet poster
 
Posts: 140
Default InsertFirst

Not sure why you would want to save to the 1st row.

The procedure that you listed, finds the last used row, then inserts the new
data to the row offset by 1 row.
If you have no data, the procedure will use the 1st row.

If its that you want to insert Column headings for your data, you could use

With historyWks.Range("A1:F1")
.Value = VBA.Array("Title1", "Title2", "Title3", "Title4", "Title5",
"Title6")
.Font.Bold = True
End With

HTH

"kyoshirou" wrote:

Hello..

I have this code:
As new data is save at the last row, how do i make it to save on the first
row? Do i use FirstRow?

Any website to teach?

Thanks!


Set inputWks = Worksheets("MAIN")
Set historyWks = Worksheets("Data")

With historyWks
nextRow = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).Row
End With

With inputWks
Set myRng = .Range(myCopy)

If Application.CountA(myRng) < myRng.Cells.Count Then
MsgBox "Please fill in all the cells!"
Exit Sub
End If
End With