+ Reply to Thread
Results 1 to 3 of 3

Excel VBA Copy and Paste Range

  1. #1
    Registered User
    Join Date
    07-08-2017
    Location
    Minnesota
    MS-Off Ver
    Microsoft Office 2016
    Posts
    78

    Excel VBA Copy and Paste Range

    Hello,



    Please open workbook and navigate to Sub Copy_Paste_Reclass_Tab(). It is module6. Navigate to the end of of the macro. I am confused on how to build something that is able to copy the range directly above and paste directly below in this range, but to flip the dollar sign. The reason I am unsure is because the number of rows will differ from time to time, so I can not just simply copy and paste in a specific cell range. Can someone please help? Let me know if you are needing more clarification.



    Thank you!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Excel VBA Copy and Paste Range

    Hi
    May be?
    Change to
    Please Login or Register  to view this content.
    Last edited by mohadin; 11-26-2019 at 04:04 AM.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel VBA Copy and Paste Range

    Hi,

    All the code below is included in Module6 of the attached copy of your modified Sample Workbook.

    You can use 'PasteSpecial' to multiply everything in a range:
    Please Login or Register  to view this content.
    You did a nice job modifying code you got from the Macro recorder. The code can be made to run faster, by eliminating the 'Select' lines, and replacing 'Paste' with direct copy, especially since most of the time you are Pasting all 100,000+ lines in the Worksheet:
    Please Login or Register  to view this content.
    The above code works fine, but is not very maintainable (i.e. easy to make a mistake when modifying). The following code is a little easier to maintain:
    Please Login or Register  to view this content.
    Lewis
    Attached Files Attached Files
    Last edited by LJMetzger; 11-26-2019 at 05:25 PM.

+ 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 range from excel and paste to text file
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-05-2019, 01:48 AM
  2. [SOLVED] Copy range and paste in a new excel file.
    By Vagelisr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2018, 07:31 AM
  3. Copy range in excel and paste in Powerpoint VBA
    By JeradAllan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2017, 08:49 AM
  4. Copy and paste Excel range as picture into Outlook email body using excel vba
    By ExcelDoc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-17-2016, 09:29 PM
  5. Excel VBA code to copy a Range and paste it within a cell
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2014, 02:40 AM
  6. [SOLVED] Copy / Paste a range from Excel to a textbox in IE
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-29-2013, 03:10 AM
  7. Replies: 0
    Last Post: 08-29-2011, 09:31 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