+ Reply to Thread
Results 1 to 5 of 5

Fixing macro to choose a blank row

  1. #1

    Fixing macro to choose a blank row

    Hi

    I am trying to get this macro to paste the data into a blank row on
    another sheet any ideas?

    Private Sub SUBMIT_Click()
    Application.ScreenUpdating = False
    Sheets("LOG TASK").Select
    Range("b1:b10").Select
    Selection.Copy
    Sheets("TASKS TO DO").Select
    Range("A1").End(xlDown)(2).Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
    SkipBlanks:= _
    False, Transpose:=True

    End Sub


  2. #2
    Norman Jones
    Guest

    Re: Fixing macro to choose a blank row

    Hi Nick,

    One way:

    '=============>>
    Private Sub SUBMIT_Click()
    Dim srcRng As Range
    Dim destRng As Range

    Set srcRng = Sheets("LOG TASK").Range("B1:B10")
    Set destRng = Sheets("TASKS TO DO"). _
    Cells(Rows.Count, "A").End(xlUp)(2)

    With srcRng
    destRng.Resize(.Rows.Count, .Columns.Count).Value = .Value
    End With

    End Sub
    '<<=============


    ---
    Regards,
    Norman


    <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I am trying to get this macro to paste the data into a blank row on
    > another sheet any ideas?
    >
    > Private Sub SUBMIT_Click()
    > Application.ScreenUpdating = False
    > Sheets("LOG TASK").Select
    > Range("b1:b10").Select
    > Selection.Copy
    > Sheets("TASKS TO DO").Select
    > Range("A1").End(xlDown)(2).Select
    > Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
    > SkipBlanks:= _
    > False, Transpose:=True
    >
    > End Sub
    >




  3. #3
    Nick Marcell
    Guest

    Re: Fixing macro to choose a blank row

    Thanks , that works great. the only problem i have is the pasted data
    needs to go from being in a column to a row.


  4. #4
    Norman Jones
    Guest

    Re: Fixing macro to choose a blank row

    Hi Nick,

    > Thanks , that works great. the only problem i have is the pasted data
    > needs to go from being in a column to a row.


    Try:
    '=============>>
    Private Sub SUBMIT_Click()
    Dim srcRng As Range
    Dim destRng As Range

    Set srcRng = Sheets("LOG TASK").Range("B1:B10")
    Set destRng = Sheets("TASKS TO DO"). _
    Cells(Rows.Count, "A").End(xlUp)(2)

    With srcRng
    destRng.Resize(1, .Rows.Count).Value = _
    Application.Transpose(.Value)
    End With

    End Sub
    '<<=============

    Alternatively, try:
    '=============>>
    Private Sub SUBMIT_Click()
    Dim srcRng As Range
    Dim destRng As Range

    Set srcRng = Sheets("LOG TASK").Range("B1:B10")
    Set destRng = Sheets("TASKS TO DO"). _
    Cells(Rows.Count, "A").End(xlUp)(2)

    srcRng.Copy
    destRng.PasteSpecial Paste:=xlValues, _
    Operation:=xlNone, _
    SkipBlanks:=False, _
    Transpose:=True
    Application.CutCopyMode = False
    End Sub
    '<<=============


    ---
    Regards,
    Norman



  5. #5
    Nick Marcell
    Guest

    Re: Fixing macro to choose a blank row

    Thats great first one works a charm Thank you


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1