+ Reply to Thread
Results 1 to 5 of 5

Copy from One sheet to Other SHeet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Wink Copy from One sheet to Other SHeet

    I want to Copy value from Sheet 1 (A1) to the Remaining Cells of Column D in Sheet 2

    Macro recording is not working. Appreciate if someone helps me to write proper code



        Sheets("Sheet1").Select
        Range("A1").Select
        Selection.Copy
        Sheets("Sheet2").Select
        ActiveCell.Offset(0, -1).Range("A1").Select
        Selection.End(xlDown).Select
        ActiveCell.Offset(0, 1).Range("A1").Select
        Range(Selection, Selection.End(xlUp)).Select
        ActiveCell.Offset(-1, 0).Range("A1:A2").Select
        ActiveCell.Activate
        ActiveSheet.Paste
        Application.CutCopyMode = False
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Copy from One sheet to Other SHeet

    Here you go

    Sub copyover()
    Dim s1, s2 As Worksheet
    Dim lr As Long
    Set s1 = Sheet1
    Set s2 = Sheet2
    lr = Cells(Rows.Count, "B").End(xlUp).Row
    
    s2.Range(Cells(6, 4), Cells(lr, 4)) = s1.[A1]
    s2.Range(Cells(6, 4), Cells(lr, 4)).NumberFormat = "m/d/yyyy"
    End Sub

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,642

    Re: Copy from One sheet to Other SHeet

    Sub test()
        Sheets("sheet1").Range("a1").Copy
        With Sheets("sheet2")
            On Error Resume Next
            .Range("a6", .Range("a" & Rows.Count).End(xlUp)).Columns("d").SpecialCells(4).PasteSpecial
            On Error GoTo 0
        End With
    End Sub

  4. #4
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,392

    Re: Copy from One sheet to Other SHeet

    Sheet2.Range("D6:D" & Sheet2.Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(xlCellTypeBlanks).Cells = CDate(Sheet1.Range("A1"))
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Copy from One sheet to Other SHeet

    thanks both codes working fine. Problem solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 01-23-2016, 01:16 PM
  2. Replies: 2
    Last Post: 01-18-2014, 10:54 PM
  3. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  4. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  5. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  6. Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data
    By thinkspac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 02:27 PM
  7. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 PM

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