Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

255 Character Limit 1

Status
Not open for further replies.

NigelHarper

Technical User
Apr 3, 2001
13
GB
If I try to output the statement:

ActiveWorkbook.ActiveSheet.Cells.SpecialCells(xlFormulas, 23).DirectPrecedents.Address

...to a range on a sheet; if there are a lot of formulas and precedents I only ever get the first 255 characters. Why is this and how can I get the whole lot with out looping through the individual cells?

Thanks,
Nigel
 
'this code inserts the address string into the cell("j5").

Dim strMyVar As String
Dim i As Range, areaMyAr As Areas

Set myRange = ActiveWorkbook.ActiveSheet.Cells.SpecialCells(xlFormulas).DirectPrecedents
ActiveWorkbook.ActiveSheet.Cells.SpecialCells(xlFormulas).DirectPrecedents.Select
Set areaMyAr = Selection.Areas
For Each i In areaMyAr
If strMyVar <> &quot;&quot; Then strMyVar = strMyVar & &quot;,&quot; & i.Address Else strMyVar = i.Address
Next i
Range(&quot;j5&quot;).FormulaR1C1 = &quot;'&quot; & strMyVar
MsgBox Len(strMyVar)

ide
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top