trying to drag 2 cells down at a time returning same cell value and on ?

zone709

Well-known Member
Joined
Mar 1, 2016
Messages
2,129
Office Version
  1. 365
Platform
  1. Windows
I hve ts in cell B3 and B4.I need to pull the return in like this a I drag down. If I rag this down holding both cells it will go to =data!d10 =data!d10. I need it to go to =data!d9 =data!d9 and so on 10 11 12. Ned to pull in 2 cells at a time. Any help thanks



=data!d8
=data!d8
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
are you able to put the formula in same row but in different columns: A1 and B1 as example? might be easier than what you are trying to do
then drag it down
 
Last edited:
Upvote 0
All I can think of is with a helper column.

A1 = 9, A2 = 9, A3 = 10, A4 = 10
B1 =INDIRECT("data!D"&A1)

Drag B1 down to B4, then select A1:B4 and drag down.

Might be easier with VBA

Code:
Sub twoatatime()


Dim ws As Worksheet
Dim ws2 As Worksheet
Dim LastRow As Long
Dim rownum As Long
Dim rownum2 As Long


Set ws = ActiveSheet
Set ws2 = Sheets("Data")


LastRow = ws2.Cells(ws2.Rows.Count, "D").End(xlUp).Row


rownum2 = 1
rownum = 9
Do Until rownum = LastRow + 1
ws.Cells(rownum2, 1).Value = ws2.Cells(rownum, 4).Value
ws.Cells(rownum2 + 1, 1).Value = ws2.Cells(rownum, 4).Value
rownum = rownum + 1
rownum2 = rownum2 + 2
Loop


End Sub
 
Upvote 0
are you able to put the formula in same row but in different columns: A1 and B1 as example? might be easier than what you are trying to do
then drag it down

Not really i am just trying to use to pull in the from the sheet but 2 cells at a time returning same cell 2 at a time. I know there is away to do it but little complicated for me. I have to drag it down 3000 cells. If it was only like 10 cells then i would do it manually.
 
Upvote 0
All I can think of is with a helper column.

A1 = 9, A2 = 9, A3 = 10, A4 = 10
B1 =INDIRECT("data!D"&A1)

Drag B1 down to B4, then select A1:B4 and drag down.

Might be easier with VBA

Code:
Sub twoatatime()


Dim ws As Worksheet
Dim ws2 As Worksheet
Dim LastRow As Long
Dim rownum As Long
Dim rownum2 As Long


Set ws = ActiveSheet
Set ws2 = Sheets("Data")


LastRow = ws2.Cells(ws2.Rows.Count, "D").End(xlUp).Row


rownum2 = 1
rownum = 9
Do Until rownum = LastRow + 1
ws.Cells(rownum2, 1).Value = ws2.Cells(rownum, 4).Value
ws.Cells(rownum2 + 1, 1).Value = ws2.Cells(rownum, 4).Value
rownum = rownum + 1
rownum2 = rownum2 + 2
Loop


End Sub

Ok ill try this thanks for the reply
 
Upvote 0
Figured it out

=IF(INDIRECT("Data!D" & INT((ROW()-3)/2)+8)=0,"",INDIRECT("Data!D" & INT((ROW()-3)/2)+8))

This pulls in on every 2 cells what I needed thanks guys
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top