+ Reply to Thread
Results 1 to 2 of 2

Auto Copy Paste Special each time Excel auto generates new set of numbers.

Hybrid View

HelpHelpHelp Auto Copy Paste Special each... 12-24-2023, 07:53 AM
nankw83 Re: Auto Copy Paste Special... 12-24-2023, 09:23 AM
  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    97

    Auto Copy Paste Special each time Excel auto generates new set of numbers.

    Hi,

    I hope to catch someone who loves working even-though X'mas is coming

    My question is, is their a way to perform Copy Paste Special automatically?

    As we know, Excel can generate a row (or more) of random numbers and auto re-generates new set of numbers when certain key are clicked. This is very useful for me.
    Here is my problem, I need hundred of rows and it's laborious to just Paste Special (values and number formats) several hundred times.

    So in sheet 1, let say A1:A10 I have up to 10 random numbers generated. I copy this row.
    In sheet 2, I Paste Special this starting at A1. It then auto regenerates and I put the cursor to A2 and Paste Special again. Then A3, A4...A200. Could this action be automated?

    I hope someone is magical here.

    Thanks
    HHH

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,713

    Re: Auto Copy Paste Special each time Excel auto generates new set of numbers.

    Hi HHH,

    Try below code ...

    Sub test()
    
    Dim a(1 To 50, 1 To 10) 'change 50 to # rows needed & 10 to # of columns needed
       
    For x = 1 To UBound(a)
       For y = 1 To UBound(a, 2)
          a(x, y) = WorksheetFunction.RandBetween(1, 100)
       Next
    Next
    
    Sheets("Sheet1").[A1].Resize(UBound(a), UBound(a, 2)) = a
    
    End Sub
    Last edited by nankw83; 12-24-2023 at 09:25 AM.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

+ 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. Excel auto-groups tabs when I try to paste special
    By swchoi89 in forum Excel General
    Replies: 3
    Last Post: 08-11-2020, 07:47 PM
  2. Replies: 14
    Last Post: 09-05-2017, 11:32 AM
  3. Excel simulation help (Auto copy and paste)
    By beamthegreat in forum Excel General
    Replies: 3
    Last Post: 07-05-2016, 11:14 AM
  4. Auto run macro from paste or paste special in to specific cell
    By Craig Muir in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2014, 10:00 AM
  5. [SOLVED] Macro that auto generates Email within Excel
    By Gambinus in forum Excel General
    Replies: 5
    Last Post: 01-26-2013, 03:24 PM
  6. disable copy paste and auto date and time
    By sabilabry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-30-2011, 03:55 PM
  7. Auto Sort, Auto Lock, Auto Date & Time Stamp
    By suehatesyou in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2010, 02:57 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