+ Reply to Thread
Results 1 to 3 of 3

Copy Paste Macro into a new cell

Hybrid View

  1. #1
    Registered User
    Join Date
    03-16-2018
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    8

    Copy Paste Macro into a new cell

    Hi Guys,

    I have a data that updates daily let just say on cell A1. What I am trying to do is I want to copy paste the data from cell A1 automatically every time I press the button and paste it into cell B1. As I mentioned earlier, the data is updated daily so the number on cell A1 changes everyday, so I want the value for the next day is pasted on cell B2, B3, B4, and so on.

    thanks

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Copy Paste Macro into a new cell

    Sub Log_Value()
        If [B1] = Empty Then
            [B1] = [A1]
        Else
            Range("B" & Rows.Count).End(xlUp).Offset(1) = [A1]
        End If
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Copy Paste Macro into a new cell

    Welcome to the forum.

    You may try something like this...

    Sub CopyData()
    Range("A1").Copy
    If Range("B1").Value = "" Then
        Range("B1").PasteSpecial xlPasteAll
    Else
        Range("B" & Rows.Count).End(3)(2).PasteSpecial xlPasteAll
    End If
    Application.CutCopyMode = 0
    End Sub
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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: 0
    Last Post: 01-13-2016, 08:50 PM
  2. Replies: 1
    Last Post: 07-22-2015, 05:23 PM
  3. Copy one cell, paste right below with macro
    By tsakta13ole in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2015, 09:24 AM
  4. [SOLVED] Macro to copy a specific cell and paste in another cell, for all sheets in workbook
    By lyoung1124 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2014, 10:15 AM
  5. Replies: 3
    Last Post: 04-04-2014, 11:34 AM
  6. Replies: 1
    Last Post: 01-03-2014, 03:01 AM
  7. Copy and Paste macro needs to paste to a changing cell reference
    By loulou in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2005, 07:06 AM

Tags for this Thread

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