+ Reply to Thread
Results 1 to 10 of 10

paste data on the clipboard starting at a specific cell

  1. #1
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    paste data on the clipboard starting at a specific cell

    there is a table of data that has been copied to the clipboard from another application.
    create a simple macro that pastes this data reliably into current sheet starting at cell B6.
    if any error happens (never does, but perhaps the clipboard data is longer than 19 columns) then notify the user with a dialogue box.

    so far i have this non-working code. i am NOT a programmer, i do not understand VBA. feel free to completely change this.

    thank you all in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: paste data on the clipboard starting at a specific cell

    Try this one.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: paste data on the clipboard starting at a specific cell

    that seems to copy all the data to one cell, cell B6. rather, the table that is on the clipboard should start pasting at B6 and retain all relative cell structure i.e. rows & cols that are on the clipboard get translated to excel (just as a normal Paste command would).

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: paste data on the clipboard starting at a specific cell

    The first question I would ask is, does it paste manually as you want? If not, then I don't how to help without knowing what application you copied from and the contents. IF it does work, then it can sort of be done using API's. My sort of, I mean that determining the number of "columns" can not be determined until after it is pasted. Of course one can then clean up as needed manually or by a macro.

  5. #5
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: paste data on the clipboard starting at a specific cell

    ok i can understand that this may be complex based on the format of the data on the clipboard. this data is coming from a proprietary financial application and will always have 11 columns and an uncertain number of rows. if it is any clue, a regular Edit>Paste handles it perfectly, that is, pasting values only, cell by cell. if this is not helpful i will paste some data here.

  6. #6
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: paste data on the clipboard starting at a specific cell

    If going through Edit > Paste does the trick, why write a macro for it? Wouldn't CTRL+V do the same?

  7. #7
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: paste data on the clipboard starting at a specific cell

    exactly, but i want to assign it to a button.

  8. #8
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: paste data on the clipboard starting at a specific cell

    Rriiigghhttt. Try this.

    Please Login or Register  to view this content.
    Disclaimer: Settings in Texts to Column can mess with how it is being pasted.

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: paste data on the clipboard starting at a specific cell

    Just put the code that quekbc showed with your modification as needed into an ActiveX commandbutton control's click event or assign a macro for a form commandbutton.
    Please Login or Register  to view this content.
    Of course if it were me, I would just paste by Ctrl+V or Shift+Ins unless I wanted some automation of course. Naturally, automation is what macros are all about.
    Last edited by Kenneth Hobson; 07-17-2015 at 08:39 AM.

  10. #10
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: paste data on the clipboard starting at a specific cell

    thank you all. quekbc 's simple version was all i needed. cheers

+ 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. Replies: 0
    Last Post: 03-29-2015, 08:11 PM
  2. Copy cell content to clipboard to paste into a pdf
    By kevinm3u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2014, 03:30 PM
  3. Enter Data from userform into cells starting from specific cell
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2014, 04:26 PM
  4. Paste specific columns from clipboard into excel
    By frankienap in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2013, 10:51 AM
  5. copy a cell multiple times depending on cell value starting on a specific cell
    By weritadiojomiel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2013, 05:25 AM
  6. [SOLVED] Copy Data to New Sheet, Starting in a Specific Row
    By RTOMikey in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-23-2013, 09:35 PM
  7. Replies: 5
    Last Post: 09-30-2010, 01:50 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