VBA problem with using relative cell offset value in change link function

nymark

New Member
Joined
Apr 19, 2020
Messages
9
Office Version
  1. 2010
I am trying to write a simple macro that will change the file link path/name from the active cell to the value in the cell directly to the right of it....

I tried this:
Dim new_ss As String

ActiveSheet.Calculate

new_ss = ActiveCell.Offset(0, 1).Value

ActiveWorkbook.ChangeLink Range(ActiveCell()), _
Range("new_ss"), xlExcelLinks

But its not working. I know the problem is in the change link to file name variable....

The macro works when I use the names of the two cells.... but I make it realtive to which ever cell lin the SS I am on....

I also tried without the new_ss viable and just using the activecell.offset function in the changelink command...

What am I missing?

Thanks
 

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,090
Office Version
  1. 2013
Platform
  1. Windows
Too bad, I am not familiar with "old fashion" links ...
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Watch MrExcel Video

Forum statistics

Threads
1,113,876
Messages
5,544,826
Members
410,637
Latest member
hulse509
Top