+ Reply to Thread
Results 1 to 16 of 16

Insert Values only

  1. #1
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Insert Values only

    Hi,

    Currently I'm using:

    Please Login or Register  to view this content.
    Is there a faster way to do this that only inserts the values? I do require an insert, not just a paste.
    Last edited by stockgoblin42; 05-14-2013 at 03:27 PM.
    live logic & long prosper

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Insert Values only

    With Faster, do you mean a faster Macro or a Smaller Macro?

    Coz as far as those above codes are concerned, its fast enough..
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Insert Values only

    I mean faster, plain and simple because it's in a loop that does it hundreds of times.

    I recently learned the faster way of copy and paste without the Selecting and Activating and I was wondering if Insert was like that too.

    Also, I want to insert just the values as the above does the formulas too and I don't want them.

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Insert Values only

    As far as my knowledge is concerned, there is no faster way. The best you can do is turn Screenupdating to false.

    This would increase your macro speed.

    Thank You,

    Deep

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Insert Values only

    Hi, stockgoblin42,

    maybe
    Please Login or Register  to view this content.
    where no change of the active sheet is done.

    @Deep:
    Any Select or Activate will slow any action down increasingly. ScreenUpdating may speed things up but the slowliness comes from other parts which by using them properly will increase speed without turning Updating off.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Insert Values only

    Noted!!

    Thank You,

    Deep

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Insert Values only

    Hello stockgoblin42,

    If you don't need to copy over the cell formatting then the quickest way is by direct assignment...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Insert Values only

    Hi, Leith,

    and that sniplet will insert the cells into the sheet where the values are copied like
    Please Login or Register  to view this content.
    from the opening post show? I dare to doubt.

    CIao,
    Holger

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Insert Values only

    Hello Holger,

    I forgot to mention, for this method to work the ranges must have the same number of rows and columns. The example below will overwrite any previous information on the second sheet.
    Please Login or Register  to view this content.
    If the values from the first sheet are to be appended to the existing data then the code would be this...
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Insert Values only

    Hi,


    I'm getting an Expected End of Statement with the Offset highlighted when I replace:

    Please Login or Register  to view this content.
    with your suggestion of:

    Please Login or Register  to view this content.


    Any ideas Why?
    Last edited by stockgoblin42; 05-17-2013 at 10:55 AM.

  11. #11
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Insert Values only

    Hi, stockgoblin42,

    I bet you can figure it out by youurself if you count out how many rows there are from 2 to 6 - definitely not 1.

    And as mentioned the code would always overwrite the same area.
    Please Login or Register  to view this content.
    Ciao,
    Holger

  12. #12
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Insert Values only

    Oh, I'm looking for an insert, definately not an overwrite

    something to replace:

    Please Login or Register  to view this content.
    but faster, without the selecting

  13. #13
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Insert Values only

    Hi, stockgoblin42,

    maybe have a look at the code provided in my first post in this thread.

    Ciao,
    Holger

  14. #14
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Insert Values only

    That code is still copying the formulas. I'm just after the values.

    Please Login or Register  to view this content.
    I tried adding .Value but no luck.

  15. #15
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Insert Values only

    Hi, stockgoblin42,

    maybe try
    Please Login or Register  to view this content.
    Ciao,
    Holger

  16. #16
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Insert Values only

    I rethought it and we missed the obvious:

    Please Login or Register  to view this content.

    any chance you could help with:

    http://www.excelforum.com/excel-form...23#post3247023

    thanks for any help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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