Results 1 to 4 of 4

Macro Speed

Threaded View

learningkid0808 Macro Speed 05-18-2011, 01:33 PM
TMS Re: Macro Speed 05-18-2011, 03:51 PM
learningkid0808 Re: Macro Speed 05-19-2011, 07:05 AM
royUK Re: Macro Speed 05-19-2011, 07:55 AM
  1. #1
    Registered User
    Join Date
    05-10-2011
    Location
    india
    MS-Off Ver
    MS365
    Posts
    28

    Macro Speed

    Hi All

    This is my first macro code, unfortunately it's taking long time to genereate nearely 8 min.

    Need help on this
    Sub report()
    
    Dim F1 As String
    Dim F2 As String
    Dim F3 As String
    
    'Formulas for vlookup
    
    F1 = "=+VLOOKUP(RC[-1], Report Apr 20'!C[-1]:C7,6,0)"
    F2 = "=+VLOOKUP(RC[-2],' Report Apr 20'!C[-2]:C7,5,0)"
    F3 = "=+VLOOKUP(RC[-3],' Report Apr 20'!C[-3]:C6,4,0)"
    
        Columns("C:E").Select
        Selection.Insert Shift:=xlToRight
    [C1].Value = "PC / MAG"
    [D1].Value = "BU / LOB"
    [E1].Value = "BS / BG"
    
    Application.ScreenUpdating = False
    
    
    Range("c2").Select
    Do While IsEmpty(ActiveCell.Offset(0, -1)) = False
        ActiveCell.FormulaR1C1 = F1
        ActiveCell.Offset(1, 0).Select
        Loop
    Range("d2").Select
    Do While IsEmpty(ActiveCell.Offset(0, -1)) = False
        ActiveCell.FormulaR1C1 = F2
        ActiveCell.Offset(1, 0).Select
        Loop
    Range("E2").Select
      Do While IsEmpty(ActiveCell.Offset(0, -1)) = False
        ActiveCell.FormulaR1C1 = F3
        ActiveCell.Offset(1, 0).Select
        Loop
    Last edited by learningkid0808; 05-23-2011 at 07:53 AM. Reason: Fixed Code Tags

Thread Information

Users Browsing this Thread

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

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