Patchworks
New Member
- Joined
- Jul 15, 2009
- Messages
- 23
I have the following code and would like to have it inserted in to a named range when saved? It only adds the data to the last empty row and not in to the range!
Since it does not add to my named range, it causes problems in other parts of the worksheet!
Thanks in advance for your help,
g
Since it does not add to my named range, it causes problems in other parts of the worksheet!
Code:
Private Sub Save_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Forums Postings")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 1).Value = frmForumsPosting.ForumID.Caption
ws.Cells(iRow, 2).Value = frmForumsPosting.ForumURL.Caption
End Sub
Thanks in advance for your help,
g