ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copying with transpose and VB code (https://www.excelbanter.com/excel-discussion-misc-queries/208896-copying-transpose-vbulletin-code.html)

Keith

Copying with transpose and VB code
 
I have 3 Q's that I require help with.

I want to copy a row of information from one worksheet to another using the
transpose, as the copy needs to run down a column on the sheet I'm copying
to, but it always returns an absolute column and relative row, instead of
relative column absolute row!

Q. How do I get it to return relative column and absolute row?

Q. Is there a way to set all cell references within a worksheet to absolute
cell references in 1 fell swoop instead of having to do each cell
individually?

Q. Can anyone give me some VB code to do the following in a macro,
Increment the row, column and range references by 1, then repeat the code
incrementing the row, column and range ref's each time for a set number of
times (442 total), then end the code/macro. I started the code below, which
works and I can copy it, but have to edit every line and 442 times is a bit
much!
ActiveCell.FormulaR1C1 = "='Shift plan'!R[-2]C[3]"
Range("C7").Select
ActiveCell.FormulaR1C1 = "='Shift plan'!R[-3]C[4]"
Range("C8").Select

Thanks to all in anticipation, Keith


joel

Copying with transpose and VB code
 

for Rowcounnt = 6 to 442
Range("C" & RowCount).formulaR1C1 = "='Shift plan'!R4C[3]"
next Rowcount



"keith" wrote:

I have 3 Q's that I require help with.

I want to copy a row of information from one worksheet to another using the
transpose, as the copy needs to run down a column on the sheet I'm copying
to, but it always returns an absolute column and relative row, instead of
relative column absolute row!

Q. How do I get it to return relative column and absolute row?

Q. Is there a way to set all cell references within a worksheet to absolute
cell references in 1 fell swoop instead of having to do each cell
individually?

Q. Can anyone give me some VB code to do the following in a macro,
Increment the row, column and range references by 1, then repeat the code
incrementing the row, column and range ref's each time for a set number of
times (442 total), then end the code/macro. I started the code below, which
works and I can copy it, but have to edit every line and 442 times is a bit
much!
ActiveCell.FormulaR1C1 = "='Shift plan'!R[-2]C[3]"
Range("C7").Select
ActiveCell.FormulaR1C1 = "='Shift plan'!R[-3]C[4]"
Range("C8").Select

Thanks to all in anticipation, Keith



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

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