+ Reply to Thread
Results 1 to 9 of 9

command button copy and paste cell l9 from sheet 1 to next available cell in column e

  1. #1
    Registered User
    Join Date
    03-06-2014
    Location
    chichester
    MS-Off Ver
    Excel 2007
    Posts
    50

    command button copy and paste cell l9 from sheet 1 to next available cell in column e

    hi everyone, I have a problem and hoping it's an easy fix, I want to copy a value of cell ("L9") on sheet1 and paste the value in the next empty cell in column E and for this to keep doing so as the value in sheet1 L9 will change all the time and need to record the values. so I created a command button so this will do it on a button click but im not sure how to write the code into VBA. Can anyone help please
    many thanks
    Joe

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    Try this in the first sheets module, I think it will do what you want:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-06-2014
    Location
    chichester
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    will this work on a command button? sorry im a novice when it comes to vba
    thanks
    joe

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    .

    Paste the following in a regular module :

    Please Login or Register  to view this content.
    Connect the Command Button to this macro.

  5. #5
    Registered User
    Join Date
    03-06-2014
    Location
    chichester
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    ok I just tried that but its not putting the value into the next cell down the column, its just adding the total to the same cell. and the reason for the command button is so I can control when it copied and pasted, sorry if I wasn't clear
    thanks
    joe

  6. #6
    Registered User
    Join Date
    03-06-2014
    Location
    chichester
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    its ok I figured it out in the end thankyou for your help and here is how I did if you was curious

    Private Sub CommandButton5_Click()
    Dim AdCash As Range
    With Sheets("Daily Reports")
    Set AdCash = .Cells(.Rows.Count, 6).End(xlUp).Offset(1, 0)
    End With
    Sheet1.Range("L9").Copy
    AdCash.PasteSpecial Paste:=xlValues, Transpose:=False
    Application.CutCopyMode = False
    Set AdCash = Nothing
    Sheets("Daily Reports").Select
    ActiveCell.Offset(1, 0).Select
    Sheet1.Select

    End Sub

    thanks again
    Joe

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    Please put your code between code tags.
    Or
    Please Login or Register  to view this content.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    Quote Originally Posted by joespencerno1 View Post
    ok I just tried that but its not putting the value into the next cell down the column, its just adding the total to the same cell. and the reason for the command button is so I can control when it copied and pasted, sorry if I wasn't clear
    thanks
    joe
    Strange, it's working as designed here.
    Attached Files Attached Files
    Last edited by Logit; 05-13-2020 at 09:31 PM.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: command button copy and paste cell l9 from sheet 1 to next available cell in column e

    Instead of the 11 lines from Post #6, did you try the one liner in Post #7?

+ 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. Copy and Paste from Sheet 11 to 12 via command button not working
    By OzDebP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2019, 01:24 AM
  2. Command Button that will Copy& Paste into next empty column to the right in SAME worksheet
    By Kenyanbanker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-27-2018, 03:49 PM
  3. [SOLVED] Using command button to copy cell contents and paste to different sheet, then clear cells
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2015, 10:20 AM
  4. [SOLVED] Command button to copy cells from one sheet and paste in second sheet
    By waratdenison in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 02:53 PM
  5. [SOLVED] copy selected row and paste it to another sheet command button vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 03:22 AM
  6. [SOLVED] VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button
    By Angnz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2013, 10:06 PM
  7. copy and paste data from one worksheet cell to another using command button
    By jasonruiz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2011, 04:34 AM

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