Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

how do i create

Forum home » Delegate support and help forum » Microsoft Excel Training and help » How do I create a procedure to copy a range with two rows and tw

How do I create a procedure to copy a range with two rows and tw

ResolvedVersion 2010

Yandisa has attended:
Excel VBA Introduction course

How do I create a procedure to copy a range with two rows and tw

How do I create a procedure to repeatedly copy a range with two rows and twenty columns and past as values a few rows below, until the 100 iterations or the differences between the rows is zero? And thereafter

RE: How do I create a procedure to copy a range with two rows an

Hi Yandisa

Thanks for your question.

I have refereed it onto a trainer that has experience with automating the Solver in Excel. Could you please say a little more about any formulas that are in the range of data?

Thanks
Doug
STL

RE: How do I create a procedure to copy a range with two rows an

Hi Yandisa,

Thank you for the forum question.

I am not sure I understand what you want. If you look at the code below:

Sub CopyDown()
Dim iCounter As Integer
Dim RangeArray As Variant 'an array to store the data

RangeArray = Range("a1:t2") 'the range where you have data

For iCounter = 1 To 400 Step 4 'step 4 controls the counter in the loop.


Range("A" & iCounter + 3).Resize(2, 20) = RangeArray
Next iCounter


End Sub


This will "copy" a1:T2 and "paste" as value 100 times with 2 rows between each range.

I am confused about this part "or the differences between the rows is zero? And thereafter"

I hope this can help you in the right direction.



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Fri 3 Feb 2017: Automatically marked as resolved.

Excel tip:

Create a hyperlink navigation sheet

In large files, it is often useful to have a front sheet with hyperlinks to the key databases and summary calculations in your spreadsheet. Hyperlinks can save you and (more importantly) those less familiar with your spreadsheet a great deal of pointless scrolling between and within sheets.



Hyperlinks appear as underlined text and can jump to any cell or range name in your file. You can also use hyperlinks to jump to other files.



To create a hyperlink to a location in the active workbook: (1) Select the cell that contains the text you want to use as the hyperlink and choose Insert|Hyperlink.(2)Click Place in this document.(3)Choose the sheet you want to link to or the range name from the list of "Defined Names".(4)If necessary, type the cell reference in the Type in the cell reference box. (5) Click OK.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.