Hi,
Here is what I did by combining few things I found on the forums.
Sub Resize_Named_Range()
Dim wb As Workbook
Dim nr As Name
Dim rng As range
Set rng = Sheets("data").range("a1") "This cell has cell reference in it - sheet1!$A$1:$A$10"
Set wb = ActiveWorkbook
Set nr = wb.Names.Item("Produkcja_AD")
nr.RefersTo = rng.Text
End Sub
I almost works, the only but is that instead resizing the range into something like this:
=sheet1!$A$1:$A$10
I get "" outside
="sheet1!$A$1:$A$10"
Thx for help with getting rid of "" in the result.
Here is what I did by combining few things I found on the forums.
Sub Resize_Named_Range()
Dim wb As Workbook
Dim nr As Name
Dim rng As range
Set rng = Sheets("data").range("a1") "This cell has cell reference in it - sheet1!$A$1:$A$10"
Set wb = ActiveWorkbook
Set nr = wb.Names.Item("Produkcja_AD")
nr.RefersTo = rng.Text
End Sub
I almost works, the only but is that instead resizing the range into something like this:
=sheet1!$A$1:$A$10
I get "" outside
="sheet1!$A$1:$A$10"
Thx for help with getting rid of "" in the result.