Connect a cell dynamically with another sheet

vc47dlc

New Member
Joined
Jun 6, 2013
Messages
4
Dear all


I wrote following code


Sub Macro2()

Sheets("PRINT").Select




With ActiveSheet.UsedRange
lk = .Rows(.Rows.Count).Row
End With


For a = 1 To lk
san = Range("b" & a).Value


san2 = "'" & san & "'!" & Range("c" & a).Value
Range("e" & a).Select

ActiveCell.FormulaLocal = "=SUBSTITUTE(ADDRESS(1,CELL(" & """COL""" & "," & "bs!i67" & ",4)," & """1""" & "," & """" & ")" & "CELL(" & """ROW""" & ",bs!i67)"

Next
End Sub


san2 was created to replace "bs!I67"




The purpose of the code is


That the cell "I67" of sheet named "Bs" is dynamically linked on a summary sheet called Print using vba code. It takes "bs" from cell b1 & "I67" from cell c1




But it is not working pl help to find error in

ActiveCell.FormulaLocal = "=SUBSTITUTE(ADDRESS(1,CELL(" & """COL""" & "," & san2 & ",4)," & """1""" & "," & """" & ")" & "CELL(" & """ROW""" & "," & san2 & ")"
 

Forum statistics

Threads
1,226,859
Messages
6,193,397
Members
453,793
Latest member
MillionMonkeys

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