View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default How to enter a formula over 250 characters?

A cell formula should accept a length up to (absolute) max 1024.

Not sure why you are limited to 255/6, however AFAIK there is no way to
exceed the 1024 formula length limit other than by changing the formula to a
text value in the cell (max 32k).

Regards,
Peter T

"Darren Hill" wrote in message
...
I have a routine below,

I have a form in which data is entered. I then cycle through the
textboxes on the form, and paste the contents to a sheet.

It's all working fine, except that at one point, the contents of several
text boxes are pasted together, and pasted into a single cell. This can
often create a formula over 250 characters in length, in the following
format:
"=" & "some text" & D72 & "lots of text" & D74.

For these results, the routine below errors out at the problem line.
Is there a work around that would allow me to paste a simple-but-long
formula of over 256 characters?

Thanks.

Sub UpdateCells(sOnForm As String, ws As Worksheet, iSet As Integer,
sSetLabel As String)
Dim rgToEdit As Range
'the following line uses the parameters to find where the
' current contents of sOnForm should be pasted.

Set rgToEdit = FindSetRange(ws, iSet, sSetLabel)

rgToEdit.Formula = sOnForm '<<< here's the problem.
End Sub

Darren