+ Reply to Thread
Results 1 to 5 of 5

How to copy and paste Macro with different ranges?

  1. #1
    Registered User
    Join Date
    09-24-2014
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    8

    Question How to copy and paste Macro with different ranges?

    Hi guys. i am working on my offices inventory spreadsheet. We have to log in and out materials that are kept in a freezer. i have set up the following macro so that users can double click to insert the Tim stamp
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Intersect(Target, Range("timestamp")) Is Nothing Then Exit Sub
    Target = Now
    Cancel = True
    End Sub

    My problem is, i want to apply this macro to B11:U12, B17:U18, B23:U24 and so on for about 1000 rows. I have labeld B11:U12 as "timestamp" (not important to be named). how can my macro do this to all proceeding ranges?

    Example worksheet upon request
    Last edited by SMIengineering; 02-23-2015 at 01:57 PM. Reason: Solved

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to copy and paste Macro with different ranges?

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    09-24-2014
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    8

    Question Re: How to copy and paste Macro with different ranges?

    When I try to add a Macro to second group it gives me an error message. I tried to give you a before and after but i ran into this problem. I am new to Macros so i Apologize if i am missing something obvious. I would like to be able to copy and paste more down the list when needed without building the double click macro for each if possible. thank you
    Example.JPG
    Attached Files Attached Files

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

    Re: How to copy and paste Macro with different ranges?

    Try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-24-2014
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    8

    Re: How to copy and paste Macro with different ranges?

    Thank you!! that worked! You are a hero

+ 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. Macro to copy paste specific charts and ranges to PPT
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-02-2014, 06:07 AM
  2. Record Macro to Copy / Paste Dynamic Ranges
    By Steve N. in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-12-2013, 08:36 PM
  3. Macro to copy and paste ranges multiple times
    By MGuru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2013, 02:16 PM
  4. [SOLVED] Macro to copy and paste Ranges
    By djmarsh51 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2012, 01:58 PM
  5. Macro to copy and paste variable ranges according to values in a column
    By abinayan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2011, 11:11 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