Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2000 Returning text value Not formula from Cell

I'm trying to pull at text value out of a cell has that a formula. Ho
do I reference the text in the cell, not the formula and return i
through the function name.

This is what I have:


Code
-------------------

Public Function FindJobDates(strJobName As String, ByVal wbkBook As String, wrkSht As String) As String
Dim rngJob As Range
Dim i As Integer

On Error Resume Next

Set rngJob = Workbooks(wbkBook).Worksheets(wrkSht) _
.Range("Calendar").Cells.Find(strJobName, LookIn:=xlValues)
If Not rngJob Is Nothing Then
For i = 0 To 20
With Workbooks(wbkBook).Worksheets(wrkSht)
MsgBox .Cells(rngJob.Row - i).Text
If IsDate(.Cells(rngJob.Row - i, rngJob.Column).Text) Then
FindJobDates = .Cells(rngJob.Row - i).Text
Exit For
End If
End With
Next
Else
MsgBox "Job Not Found In Calendar."
End If
End Function

-------------------


--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Excel 2000 Returning text value Not formula from Cell

use
..Value


--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
"scain2004 " wrote in message
...
I'm trying to pull at text value out of a cell has that a formula. How
do I reference the text in the cell, not the formula and return it
through the function name.

This is what I have:


Code:
--------------------

Public Function FindJobDates(strJobName As String, ByVal wbkBook As
String, wrkSht As String) As String
Dim rngJob As Range
Dim i As Integer

On Error Resume Next

Set rngJob = Workbooks(wbkBook).Worksheets(wrkSht) _
.Range("Calendar").Cells.Find(strJobName, LookIn:=xlValues)
If Not rngJob Is Nothing Then
For i = 0 To 20
With Workbooks(wbkBook).Worksheets(wrkSht)
MsgBox .Cells(rngJob.Row - i).Text
If IsDate(.Cells(rngJob.Row - i, rngJob.Column).Text) Then
FindJobDates = .Cells(rngJob.Row - i).Text
Exit For
End If
End With
Next
Else
MsgBox "Job Not Found In Calendar."
End If
End Function

--------------------



---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2000 Returning text value Not formula from Cell

Tried that, came up ""....same as it's doing now.


--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2000 Returning text value Not formula from Cell

Ok, figured it out myself :) :


Code
-------------------

Public Function FindJobDates(strJobName As String, ByVal wbkBook As String, wrkSht As String) As String
Dim rngJob As Range
Dim i As Integer
Static rngJobNext As Range

On Error Resume Next
Set rngJob = Workbooks(wbkBook).Worksheets(wrkSht) _
.Range("A:G").Cells.Find(strJobName, LookIn:=xlValues)

If Not rngJob Is Nothing Then
For i = 0 To 20
With Workbooks(wbkBook).Worksheets(wrkSht)
'MsgBox .Cells(rngJob.Row - i, rngJob.Column).Value
If IsDate(.Cells(rngJob.Row - i, rngJob.Column).Value) Then
FindJobDates = .Cells(rngJob.Row - i, rngJob.Column).Value
Exit For
End If
End With
Next
Else
MsgBox "Job Not Found In Calendar."
End If
End Function


-------------------


--
Message posted from http://www.ExcelForum.com

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 - formula to display text from anoher worksheet Scott J Excel Discussion (Misc queries) 4 April 7th 08 02:52 AM
Finding text in a cell and returning a value based on that text [email protected] Excel Discussion (Misc queries) 5 January 10th 07 06:01 PM
Returning text using a formula AJL Excel Worksheet Functions 1 October 10th 06 01:29 PM
Complete lock up in returning to Excel 2000 Maverick Excel Discussion (Misc queries) 0 April 25th 06 03:05 PM
Excel 2000 Web query not returning all Table Data [email protected] Excel Programming 5 December 21st 03 04:14 AM


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

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

About Us

"It's about Microsoft Excel"