+ Reply to Thread
Results 1 to 4 of 4

Small Macro edit is causing pasting nightmare

  1. #1
    Registered User
    Join Date
    09-29-2020
    Location
    Vaughn, Oregon
    MS-Off Ver
    Windows 10
    Posts
    2

    Small Macro edit is causing pasting nightmare

    So I have a macro that copies a range in a row, selects another tab, finds the first empty row and paste the values in the same number of columns that it copied. It then goes back to the original tab and clears the copied values. This has worked great for month but now I have added an additional cell in the same row for it to copy and paste in the other tab. I went into the macro and simply changed the range from B5:P5 to B5:Q5. But now when it pastes on the other tab it repeats the pasted continuously over and over again down the selected row??? I did not change a thing about the paste instructions and it still does all of the other commands perfectly. I'm at a lost for how adding that one cell in the range has caused it to somehow repeat the paste down the correct row I need it to. I only need it to paste the values once per row as there are adjacent columns with formulas in them to calculate the data but now they are getting wiped out and changed to the repeated paste values. What am I missing???

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Small Macro edit is causing pasting nightmare

    What am I missing???
    Pretty difficult to know without seeing the code (and workbook).
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-29-2020
    Location
    Vaughn, Oregon
    MS-Off Ver
    Windows 10
    Posts
    2

    Re: Small Macro edit is causing pasting nightmare

    Sub EIGHTDF()
    '
    ' EIGHTDF Macro
    '

    '
    Range("B5:P5").Select changed P5 to Q5 and now it will repeat the paste horizontally in the last row over and over again.
    Selection.Copy
    Sheets("VERT 8 DF").Select
    Range("A1").Select
    Selection.End(xlDown).Offset(1, 0).EntireRow.Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("ALL VERTICAL").Select
    Range("A1").Select
    Selection.End(xlDown).Offset(1, 0).EntireRow.Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("INPUT").Select
    Range("J5:K5").Select
    Range("K5").Activate
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("H5").Select
    Selection.ClearContents
    End Sub

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Small Macro edit is causing pasting nightmare

    I'd try changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional.)

+ 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. [C#] Pasting image to excel sometimes causing error
    By iifuzz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2018, 10:25 AM
  2. [SOLVED] Macro small edit
    By makinmomb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2014, 06:10 AM
  3. Copy and Pasting Nightmare - Help with Formatting
    By Caleb9124 in forum Excel General
    Replies: 3
    Last Post: 01-24-2014, 06:25 PM
  4. Replies: 2
    Last Post: 03-25-2011, 06:37 AM
  5. edit macro that is pasting info to check column for duplicate info
    By roth_nj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2009, 05:55 PM
  6. Pasting into pivot database causing duplication
    By NMullis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-11-2007, 05:50 PM
  7. Pasting Multiple Columns causing problems
    By sgs521 in forum Excel General
    Replies: 1
    Last Post: 09-25-2007, 06:05 PM

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