Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Aloisa Miller   on Mar 07 In MS Office Category.

  
Question Answered By: Kawakib Mansour   on Mar 07

Sub FirstBlank()
select  the first line in your data
Range("C1").End(xlDown).Offset(1, 0).Select
End Sub

since you are feeding the rows from a form, you don't need to select the cell.
find the row  number of the first blank row

BlankRowNumber = Range("A1").End(xlDown).Offset(1, 0).Row

then load your data  from the form

Sub Form2Sheet()
RowNumber = Range("A1").End(xlDown).Offset(1, 0).Row 'find the first blank
row
If RowNumber < 100 Then ' ensure you are still in your range
ColNumber = 1 'Column A
With Me
.Controls("Your control Name").Value = Sheets("YOUR SHHET
NAME").Cells(RowNumber, ColNumber)
.Controls("Your control Name").Value = Sheets("YOUR SHHET
NAME").Cells(RowNumber, ColNumber + 1)
.Controls("Your control Name").Value = Sheets("YOUR SHHET
NAME").Cells(RowNumber, ColNumber + 2)
.Controls("Your control Name").Value = Sheets("YOUR SHHET
NAME").Cells(RowNumber, ColNumber + 3)
End With
End If
End Sub

Share: 

 
 
Didn't find what you were looking for? Find more on Locate the first empty row in a worksheet Or get search suggestion and latest updates.


Tagged: