+ Reply to Thread
Results 1 to 4 of 4

Write macro to bypass clipboard

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Write macro to bypass clipboard

    I found a post on converting code from being dependent on the clipboard to being independent of the clipboard. It takes this code,
    Sheets("London").Select
     Range("H9:H16").Copy
     Sheets("Yearly Total").Select
     Range("D9").Selection.PasteSpecial Paste:=xlPasteValues
     Application.CutCopyMode = False
    and converts it to this,
    Sheets("Yearly Total").Range("D9:D16") = Sheets("London").Range("H9:H16").Value
    I get this code when I record a copy and paste macro.
    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        Range("R1:R19").Select
        Selection.Copy
        ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
        Sheets("Prime Bench Main").Select
        Range("A3").Select
        Selection.End(xlToRight).Select
        ActiveCell.Offset(0, 1).Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    End Sub
    The issue I am having is getting it to work with my use of relative refrences. This macro would be used multiple times, so it would insert the text into the next available column and I don't know how to do that. Any help would be appreciated.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Write macro to bypass clipboard

    This copies the selected range to sheet Prime Bench Main

    Sub Macro1()
    '
    ' Macro1 Macro
    '
        With Selection
            Sheets("Prime Bench Main").Cells(3, Columns.Count).End(xlToLeft).Offset(, 1).Resize(.Rows.Count, .Columns.Count).Value = .Value
        End With
        MsgBox "Copy Complete"
        
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Write macro to bypass clipboard

    Sorry, I forgot to mention that the sheet that I was selecting the R1:R19 range from is the calculator sheet.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Write macro to bypass clipboard

    Sub Macro1()
        
    Sheets("Prime Bench Main").Cells(2, Columns.Count).End(xlToLeft).Offset(, 1).Resize(19).Value = Sheets("Calculator").Range("R1:R19").Value
        
    End Sub

+ 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. Bypass Clipboard when copy/pasting non-contiguous rows
    By mlj61289 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2014, 03:11 PM
  2. [SOLVED] clipboard bypass not working
    By rossg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 06:01 PM
  3. Re-Write Code Without Clipboard
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2010, 09:23 AM
  4. bypass clipboard too large comment
    By tdyl1969 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2009, 09:49 AM
  5. Replies: 0
    Last Post: 09-06-2005, 10:05 AM

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