Results 1 to 6 of 6

SpeedUp/Alternative to Offset.Value = Offset.Value

Threaded View

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Serbia
    MS-Off Ver
    Excel 2010
    Posts
    85

    SpeedUp/Alternative to Offset.Value = Offset.Value

    Is there an alternative to speed up this procedure :

    Sub AddToDB()
    
    Dim rV As Range
    Dim rDB As Range
    Dim row As Integer
    
    row = Sheets("DB").Cells(Rows.Count, 2).End(xlUp).row + 1
    Set rDB = Sheets("DB").Cells(row, 2)
    Set rV = Sheets("Valuation").Range("C4")
    
    rDB.Value = rV.Value
    rDB.Offset(0, 1).Value = rDB.Offset(0, 1).Value
    rDB.Offset(0, 4) = Date
    
    rDB.Offset(0, 5).Value = rV.Offset(10, 2).Value
    rDB.Offset(0, 6).Value = rV.Offset(11, 2).Value
    rDB.Offset(0, 7).Value = rV.Offset(12, 2).Value
    rDB.Offset(0, 8).Value = rV.Offset(13, 2).Value
    rDB.Offset(0, 9).Value = rV.Offset(14, 2).Value
    rDB.Offset(0, 10).Value = rV.Offset(15, 2).Value
    rDB.Offset(0, 11).Value = rV.Offset(16, 2).Value
    rDB.Offset(0, 12).Value = rV.Offset(17, 2).Value
    rDB.Offset(0, 13).Value = rV.Offset(18, 2).Value
    rDB.Offset(0, 14).Value = rV.Offset(19, 2).Value
    rDB.Offset(0, 15).Value = rV.Offset(20, 2).Value
    
    rDB.Offset(0, 16).Value = rV.Offset(31, 2).Value
    rDB.Offset(0, 17).Value = rV.Offset(27, 2).Value
    rDB.Offset(0, 18).Value = rV.Offset(30, 2).Value
    rDB.Offset(0, 19).Value = rV.Offset(32, 2).Value
    
    rDB.Offset(0, 20).Value = rV.Offset(4, 21).Value
    rDB.Offset(0, 21).Value = rV.Offset(7, 21).Value
    rDB.Offset(0, 22).Value = rV.Offset(14, 21).Value
    rDB.Offset(0, 23).Value = rV.Offset(16, 21).Value
    rDB.Offset(0, 24).Value = rV.Offset(22, 21).Value
    rDB.Offset(0, 25).Value = rV.Offset(25, 21).Value
    
    End Sub
    I am using it to add those values into database (another sheet), but it's very very slow.

    Thanks
    Last edited by Jovica; 12-13-2013 at 01:52 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to create dynamic ranges, better alternative to OFFSET
    By JamesGoulding85 in forum Excel General
    Replies: 2
    Last Post: 06-04-2013, 03:27 PM
  2. [SOLVED] Alternative to kloojy use of OFFSET
    By wolfgang713 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-31-2013, 02:51 PM
  3. Alternative to Offset in a formula
    By ashokunbi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-22-2013, 08:33 PM
  4. [SOLVED] Sumproduct Offset alternative needed
    By samshiells in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-06-2012, 12:18 PM
  5. Alternative for #N/A in an offset and match formula?
    By carlos2011 in forum Excel General
    Replies: 8
    Last Post: 03-17-2011, 07:10 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