Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    228

    Unanswered: How to append to a work sheet

    Say I have a form with 10 text boxes and I want to right those 10 fields as a new row at the end of an existing sheet...
    How would one accomplish this?

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi again

    Shouldn't be too dificult but you need to define 'the end of existing sheet'

    ie, will the layout/columns change with time, is the existing sheet always the same one, is it always the currently active sheet etc. ??


    MTB

  3. #3
    Join Date
    Oct 2003
    Posts
    1,091
    Here is code that will take it from cell values and appends at the end of a list. Perhaps this will give you some ideas.

    Code:
    Sub PasteList()
    Dim LstRow As Integer
    Dim myRange As Range
    Application.ScreenUpdating = False
    
        'Copies list of questions below current list (column F)
        Set myRange = Sheets("List").Range("K3:K10")
        myRange.Copy
        Sheets("Work").Range("F65536").End(xlUp).Select
        ActiveCell.Offset(1, 0).Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Application.CutCopyMode = False
        Sheets("Work").Range("G65536").End(xlUp).Select
        ActiveCell.Offset(1, 0).Select
    Application.ScreenUpdating = True
    
    End Sub
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

Posting Permissions

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