Results 1 to 7 of 7

Copy and paste macros???

Threaded View

  1. #1
    Registered User
    Join Date
    10-27-2011
    Location
    Richmond, Va. USA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Copy and paste macros???

    So I am creating a voice mail log for my department and when a teammate completes the task of returning a clients call they can click the button I have created and it will automatically fill in the current date and time for tracking purposes. Here is the code I am using:

    Private Sub CommandButton1_Click()
    
        With Sheets("Voicemail Log")
            .Range("I3").Value = Date
            .Range("I4").Value = Time
        End With
        
    End Sub
    Problem is that is the code for one button and for one record. We have anywhere between 100 and 200 voice mails to return each month. Is there a way that I can copy the entire row to include the button and the VBA so that the next line will look like this:

    Private Sub CommandButton1_Click()
    
        With Sheets("Voicemail Log")
            .Range("I5").Value = Date
            .Range("I6").Value = Time
        End With
        
    End Sub
    and so on all the way down? I know if I select the cell and grab the bottom right corner and drag it down it will copy the cells however the VBA does not come with it as I had hoped like a regular formula would.

    Any help is much appreciated!
    Attached Files Attached Files
    Last edited by jeffreybrown; 07-28-2012 at 08:52 PM. Reason: Please use code tags

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