Insert VBA function into a cell where the address differs each time.

Richard in Redditch

New Member
Joined
Feb 7, 2012
Messages
44
Hello
I have an application where I am trying to insert a formula into a cell, the address of which will alter each time through. The code I am trying to use is this:
ActiveCell.Formula = "=summary! & Cells(LastRowNo + 1, 5)". This is not correct, but I hope it shows what I am trying to. Any help will be appreciated.
Thanks
Richard
 
Perhaps something like
Code:
dim SomeRange as Range

Set SomeRange=Worksheets("Summary").Range("A65536").End(xlUp)

Worksheets("other").Range("A1").Formula = "=" & SomeRange.Address(,,,True)
 
Upvote 0
Hello
A very big "thank you" to everybody who has helped me out with the answer to my query. I did accidentally post it twice - I thought I had not got it right the first time, so apologies to anyone who thought I was taking the mickey. What a wonderful forum!
Richard
 
Upvote 0

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