Results 1 to 5 of 5

Thread: Creating a new row problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    I thinking of use IsEmpty function. But the code below is filling the lastrow - 1 (that's ok) and then creating another row (that's what I'm trying to avoid). I'd like this to have only rows that are filled, I mean, no extra blank row.


    This is the code I've just tried:


    Private Sub submit_Click()
    
    Dim lrTest As Long
    
    'Count last row
    lrTest = Sheets("Monthly Expenses").Range("B" & Rows.Count).End(xlUp).Row
    If IsEmpty(Range("C" & lrTest - 1)) Then
    'Description TextBox
    Range("C" & lrTest - 1).value = TextBox1.Text
    End If
    'Resize table row from B21 to J on the last row
    ActiveSheet.ListObjects("Table1").Resize Range("$B$21:$J$" & lrTest + 1)
    End Sub


    Ps: sorry for "double posting". I'm just trying to help you guys to help me.
    Last edited by SamT; 01-16-2016 at 11:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •