PDA

View Full Version : Return named range with vba



Sir Babydum GBE
09-06-2007, 12:36 PM
Hi

This isn't working:
wsR.Cells(iRow, 4).Value = mySite
what i want to do is return the contents of the cell i've named "mySite" (as a named range in the workbook) to the destination cell.

This just returns a blank

How do I write it correctly please?

mvidas
09-06-2007, 01:03 PM
SBD :)

wsR.Cells(iRow, 4).Value = Range("mySite").Value
'or
wsR.Cells(iRow, 4).Value = wsR.Range("mySite").Value

Sir Babydum GBE
09-09-2007, 05:49 AM
SBD :)

wsR.Cells(iRow, 4).Value = Range("mySite").Value
'or
wsR.Cells(iRow, 4).Value = wsR.Range("mySite").ValueI feel very daft at the moment.

Thanks!