+ Reply to Thread
Results 1 to 2 of 2

copying from one worksheet to another within the same workbook

  1. #1
    Registered User
    Join Date
    12-10-2004
    Posts
    40

    copying from one worksheet to another within the same workbook

    Hi excel gurus,

    How do i create a macro to copy the data from sheet1 to sheet3 and sheet2 to the ending of sheet 3 that already has the values of sheet 2??

    i was trying to first copy sheet 1 to sheet 3...its not working...here is how i started it

    Public Sub Combiningsheets()


    Dim ptipart As Range
    Dim i As Integer
    Dim x As Double
    Dim colBptipn As String
    Dim currentvalue As Range
    Dim newvalue As String
    Dim rowcopy As Range

    Worksheets("Sheet3").Cells.Clear

    Set ptipart = Worksheets("Sheet1").Range("B:B")
    ptipart.EntireColumn.Select

    Set currentvalue = ActiveCell
    MsgBox currentvalue

    Do While currentvalue.Value <> ""

    currentvalue.Select
    Selection.EntireRow.Select
    Worksheets("Sheet2").Paste


    Set currentvalue = currentvalue.Offset(1, 0)
    MsgBox currentvalue
    Loop



    'x = ptipart.Rows.Count
    'For i = 1 To x
    'Next i

    End Sub



    problem is ....it pastes nothign at all. I made arbitrary values...any advise is greatly appreciated...

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    ptipart.EntireColumn.Select

    should be

    ptipart.Select

    and also your code doesnot have selection.copy

+ 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