Results 1 to 12 of 12

Thread: get first blank row and paste formula and format from range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Yup, that's what I wanted. Thanks!!
    Only one thing, can i keep the headings? And I want a userform to input some values into their respective cells.



    These values are then placed under their respective headings in the first row right after the headings.


     
    Sub copy_it()
     
        Dim lrow            As Long
        Dim LastRow As Object
        Set LastRow = Sheet("INVENTORY").Range("a65536").End(xlUp)
     
        Load UserForm5
     
        LastRow.Offset(1, 0).Value = TextBox1.Text
        LastRow.Offset(1, 1).Value = TextBox2.Text
        LastRow.Offset(1, 2).Value = TextBox3.Text
        MsgBox "One record written to Sheet1"
        response = MsgBox("Do you want to enter another record?", _
        vbYesNo)
        If response = vbYes Then
            TextBox1.Text = ""
            TextBox2.Text = ""
            TextBox3.Text = ""
            TextBox1.SetFocus
        Else
            Unload Me
        End If
        With Sheets("INVENTORY")
            lrow = .Range("H" & Rows.Count).End(xlUp).Row + 1
            .Range("A1:N15").Copy .Range("A" & lrow)
            On Error Resume Next
            .Range("A" & lrow & ":N" & lrow + 14).SpecialCells(xlCellTypeConstants, 23).Value = ""
            On Error GoTo 0
        End With
     
    End Sub

    Something like the above. Sorry for being too messy. But i hope it's clear enough.

    Thanks!!
    Last edited by noobie; 01-15-2007 at 01:02 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
  •