Copy cells

Brodito

New Member
Joined
Aug 29, 2009
Messages
8
I am trying to copy cells in a non sequential order:
For Example, I have the following sheet:

In Sheet 1, I have
A B C D
1 A
2 B
3 C

In Sheet 2, I have
A
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9

I am trying to create in Sheet 1 a formula that allows me to have this result:

A B C D
1 A 1 2 3
2 B 4 5 6
3 C 7 8 9

I copy in Sheet 1 (B1), =Sheet 2!A1; then in (C1) =Sheet 2!A2; and in (D1) =Sheet 2!A3... Until now is fine

But when I copy in (B2), I would like to copy =Sheet 2!A4, not A2... How can I copy "NON SEQUENTIAL" cells; or, is it possible to instruct to copy A1 "PLUS" 3 positions below, incrementing 3 positions (not only one)?

Hope I make myself understood... Thanks in advance.
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

id107

Well-known Member
Joined
Apr 16, 2008
Messages
578
Not sure how to do it using a formula, but this should work:
Code:
Sub test()
 
    Dim c As Range, i As Long
 
    i = 1
 
    For Each c In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
        c.Offset(, 1).Value = "=Sheet2!A" & i
        c.Offset(, 2).Value = "=Sheet2!A" & i + 1
        c.Offset(, 3).Value = "=Sheet2!A" & i + 2
        i = i + 3
    Next c
 
End Sub
 

Brodito

New Member
Joined
Aug 29, 2009
Messages
8
Sorry but do not know how to use the programming you wrote below. Is that done in the developer mode?
 

indiantrix

Well-known Member
Joined
Oct 17, 2002
Messages
943
Put this into B1, copy it across to D1, then copy this row Down to Row 3.
HTH - Larry.
and now, for the formula! =INDIRECT("Sheet2!A"&COLUMN()-1+(ROW()*3)-3)
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,606
Messages
5,512,390
Members
408,889
Latest member
2vbr

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top