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

resolvedResolved · Medium Priority · Version 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:

Copying Values Without Formulas in Excel 2010

If you want to copy the contents of a cell but don't want to copy the formula with it then use the following simple method:

Press Ctrl+C to copy the values in the cell. On the Home tab, click Paste and then click Paste Values.

View all Excel hints and tips


Server loaded in 0.06 secs.