none
New to VB and inherited a bootstrapping macro that I do not understand RRS feed

  • Question

  • Hi, 

    I am very new to visual basic and would like some assistance in 'translating' a macro so that I can understand the functions and 'procedure' better. I am a junior in my office and have inherited a boostrapping macro to be used on a data set in MS excel, however when I asked for one of my senior colleagues to explain it to me, no one could. I have tried to search each of the functions individually, however it doesn't really piece together the whole story. I am more comfortable working in STATA, and am not as familiar with VB. I understand what a bootstrap is supposed to do, but I am struggling to understand why the macro is set up this way. 

    The purpose of the macro is to bootstrap a mean value 1000 times. The macro is as follows: 

    Sub Replications()
    '
    ' Replications INT1 Macro
    '

    Index = 0
    Range("B7:P7").Select
    Selection.Copy

    Do While Index < 1000

    Range("B13").Select
    ActiveCell.Offset(Index, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Index = Index + 1
    Loop
    Range("A2").Select

    End Sub


    Any assistance explaining this would be greatly appreciated! 

    Thanks, 

    Zoe 


    Wednesday, October 17, 2018 11:13 PM

All replies


  • I am very new to visual basic and would like some assistance in 'translating' a macro so that I can understand the functions and 'procedure' better. I am a junior in my office and have inherited a boostrapping macro to be used on a data set in MS excel

    I think you might get more focused help for this issue in this forum:

    Microsoft Office for Developers  >  Excel for Developers
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=exceldev&filter=alllanguages

    - Wayne

    Thursday, October 18, 2018 5:26 AM
  • I will guess it copies the formula values (not formulas) from the selected row cells ("B7:P7"), inserts to ("B13") rows. and keeps blanks. Then selects rows in ("A2").
    Thursday, October 18, 2018 8:59 AM