ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying formula... (https://www.excelbanter.com/excel-programming/317822-copying-formula.html)

marc-andr?

Copying formula...
 
I want to make a "special copying" of a formula in excel.

There it is...

I Have Data in these cells for example : A1, C1, E1, G1, I1, K1, L1...
you understand the patern I guest.

I want to copy all these value, in one column..

Like put all the value with
a "=Formula" that I can copy in A25 to A500 for example.

So retrieve the A1, C1, E1, G1.... value in A25,A25,A27,A28 ... cells.

thanks!

Marc-André

KRCowen

Copying formula...
 
M-A

I am not sure if this is what you want, but the following code will take the
value in every other column of row 1 and put them in a column, starting at the
active cell. I am not sure what the limits should be on the number of columns,
so I arbitrarily run through the first 21 columns.

Sub test()

For i = 0 To 20
ActiveCell.Offset(i, 0).Value = Cells(1, 2 * i + 1).Value
Next i

End Sub

Also, your example of A25 to A500 indicates a potential problem. Since you
restricted to 256 columns, and you are only using half the columns, if you
start in A25 you can't have enough data to go beyond ~A150, as I understand it
anyway.

I hope this helps.

Good luck,

Ken
Norfolk, Va


All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com