My variable is equal to a cell link how can I insert the cell link into a cell

albertocv

New Member
Joined
Dec 29, 2011
Messages
4
NombreHojanPos ="$0$31" right now but it changes,
I want to paste =$0$31 into the cell d15 of my new sheet, so Whenever I change it on the original list, it will change here too.

I can't seem to manage to insert this cell reference. I know it must be something easy, but I am a beginner and completely self taught

This is what I have so far:

NombreHojanPos = Cells(lastrow + 1, 15).Address


'copiar Certificado

Sheets("Certificado").Select
Sheets("Certificado").Copy After:=Sheets(3)
ActiveSheet.Name = NombreHojan
Sheets(NombreHojan).Select
Range("d15").Select
Range("d15").Value = NombreHojanPos.Value



 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Unless NobreHojan is declared somewhere as a variable, you would need quotation marks around it as shown in this snippet.
Code:
ActiveSheet.Name = "NombreHojan"
 Sheets("NombreHojan").Select
then you need 'Range' in front of NombreHojanPos.Value since it equates to an address and not a range object.
Code:
Range("d15").Value = Range(NombreHojanPos).Value 'No quote marks here because it is a variable representing an address.
 
Upvote 0
I want to paste =$0$31

Really not sure I am reading this correctly but if not might get some clarification back...

Code:
 Sheets("Certificado").Copy After:=Sheets(3)
 ActiveSheet.Name = [COLOR="#FF0000"]"[/COLOR]NombreHojan[COLOR="#FF0000"]"[/COLOR]
 Sheets([COLOR="#FF0000"]"[/COLOR]NombreHojan[COLOR="#FF0000"]"[/COLOR]).Range("d15").Value = [COLOR="#FF0000"]"=" & NombreHojanPos[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,626
Messages
6,125,896
Members
449,271
Latest member
bergy32204

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