+ Reply to Thread
Results 1 to 4 of 4

Copy morning and evening data and pasting in another sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    10-28-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Copy morning and evening data and pasting in another sheet

    In Sheet1 ColA contains today's date and ColB contains morning. ColB of the next row on the same sheet contains evening.

    Now what I want is that in another sheet the macro will copy and paste the data in today's date in the morning row and in the evening row. Can any body help me with the coding please?

    Thanks
    Nilan

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Copy morning and evening data and pasting in another sheet

    let us suppose the data is like this in sheet1 of attached file.nilan.xls




    try this macro and see sheet 2
    Sub test()
    Dim r As Range, c As Range, r1 As Range, dest As Range
    Worksheets("sheet2").Cells.Clear
    Worksheets("sheet1").Activate
    Set r = Range(Range("a2"), Range("A2").End(xlDown))
    For Each c In r
    Set r1 = Range(c, c.End(xlToRight))
    Set dest = Worksheets("sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
    r1.Copy
    dest.PasteSpecial Transpose:=True
    Next c
    Application.CutCopyMode = False
    End Sub
    Attached Files Attached Files

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Copy morning and evening data and pasting in another sheet

    What have you got so far?

  4. #4
    Registered User
    Join Date
    10-28-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Copy morning and evening data and pasting in another sheet

    Thank you so much for the reply.

    I want the data to be copied in the format as it is given in the attached file.

    Sheet 1 will contain blank cells in between the numbers like this and this blank cells will contain formula in sheet 2. The data will change everyday in morning and evening in sheet1in the same row. SO the macro will be run twice, once in the morning and again in the evening. And in sheet 2 it will copy by seeing today's date and recognising it as morning or evening.

    Hope I am clear in what I have said.

    Thank you again for your prompt reply.

    Nilan
    Attached Files Attached Files

+ 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