• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How can I copy and paste using an Array formulas within my Macro

Presently I am using a Macro that will copy / paste or copy and insert to move the data from the Drawn Number sheet to the Input sheet. The problem I am running in to is when it inserts the new numbers in columns I to N the Array formulas in columns B to G do not change nor move down correctly to "match" the data in I to N. Is there a different method I can use (other than an Array) or a way to change up my Macro to accommodate this so it works properly?



Here is the file with Macros

https://www.mediafire.com/?h5fnq0fh02s3u04
Here are the Macros

Code:
Sub NumbersGrabber()
  Dim InputSht As Worksheet
  Dim DrnNumSht As Worksheet
  Dim i, r As Long
  Dim LastRowFound As Boolean
  Set InputSht = Sheets("Input")
  Set DrnNumSht = Sheets("Drawn Number ")
 
  LastRowFound = False
  r = 1
  Do
  r = r + 1
  If Not WorksheetFunction.IsNumber(DrnNumSht.Cells(r, "I")) Then
  LastRowFound = True
  r = r - 1
  End If
  Loop Until LastRowFound
 
  For i = r To 2 Step -1
  DrnNumSht.Cells(i, "I").Resize(, 7).Copy
  InputSht.Range("I49").Resize(, 7).Insert shift:=xlShiftDown
  ertert
  Next i
End Sub
 
Back
Top