ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveCell.Formula to equal a specific cell (https://www.excelbanter.com/excel-programming/392320-activecell-formula-equal-specific-cell.html)

Aaron

ActiveCell.Formula to equal a specific cell
 
I'm trying to set my active cell to equal B34. But when I do it, the formula
is in R1C1 format. Next time the macro runs, B34 will be in a different
position relative to my active cell. What should the code look like if I
want ActiveCell.Formula = B34???

Mike H

ActiveCell.Formula to equal a specific cell
 
Try,

Range("b34").Copy
With ActiveCell
.PasteSpecial
End With

Mike

"Aaron" wrote:

I'm trying to set my active cell to equal B34. But when I do it, the formula
is in R1C1 format. Next time the macro runs, B34 will be in a different
position relative to my active cell. What should the code look like if I
want ActiveCell.Formula = B34???


JLatham

ActiveCell.Formula to equal a specific cell
 
or one of these:
Activecell.Formula = "=$B$34"
or
ActiveCell = Range("B34").Value

"Mike H" wrote:

Try,

Range("b34").Copy
With ActiveCell
.PasteSpecial
End With

Mike

"Aaron" wrote:

I'm trying to set my active cell to equal B34. But when I do it, the formula
is in R1C1 format. Next time the macro runs, B34 will be in a different
position relative to my active cell. What should the code look like if I
want ActiveCell.Formula = B34???



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

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