Thread: formula in VB
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
peyman peyman is offline
external usenet poster
 
Posts: 189
Default formula in VB

the Error is on this line:
..Cells(Rows.Count, 1).End(xlUp).OFFST(1,0).select

"Kevin B" wrote:

In code for your command button you have

Private Sub CommandButton18_Click()
RUN "HYPERLINK"
End Sub

All you need to do is call your sub routine by its name only, no RUN command
or quotation marks around the sub name.

Private Sub CommandButton18_Click()
HYPERLINK
End Sub


Are you trying to get this to cycle through all the worksheets with a single
click, running your HYPERLINK sub for each of the Worksheets? If that's the
case you can try something like:

Private Sub CommandButton18_Click()

Dim ws as Worksheet

For Each ws in ThisWorkBook.Worksheets
ws.Activate
HYPERLINK
Next ws
--
Kevin Backmann


"peyman" wrote:

THANX KEVIN,I'VE ONE MORE QUESTION.IN A STANDARD MODULE I HAVE A CODE LIKE:
Public Sub HYPERLINK()
With ActiveSheet
.Cells(Rows.Count, 1).End(xlUp).OFFST(1, 0).Select
End With
End Sub

AND FOR EACH WORKSHEETS IN THE WORKBOOK I HAVE:

Private Sub CommandButton18_Click()
RUN "HYPERLINK"
End Sub

BUT IT DOESN'T WORK.THERE IS AN ERROR LIKE:

RUN TIME ERROR "438"
OBJECT DOESNOT SUPPORT THIS PROPERTY OR METHOD.

ANY HELP?
MANY THANX




"Kevin B" wrote:

This UDF will return True/False based upon the contents of the cell. False
if empty or just a value, True if a formula

Function IsFormula(CellAddress As Range) As Boolean

Application.Volatile

IsFormula = CellAddress.HasFormula

End Function

--
Kevin Backmann


"peyman" wrote:

hi,
How can I make the VB undrestand a cell containing formula?is there any
property,object or something?