#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default formula in VB

hi,
How can I make the VB undrestand a cell containing formula?is there any
property,object or something?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default formula in VB

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default formula in VB

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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default formula in VB

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?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default formula in VB

I removed the RUN and quotation marks,but still doesn't work??

"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?



  #6   Report Post  
Posted to microsoft.public.excel.misc
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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"