Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Load TextBox With Search Result Cell From a PAge

When running this It should look for StrName, Then Go 1 box over
(Column b) and Return the data in that cell to FormLoad.TxtRatRecd3
However it Just Stays Blank, any idea why?


Private Function TPRLoad(StrName As String)
FormLoad.TxtCaseName3 = StrName
Dim C As Range
FormLoad.LblName = " TPR Sheet "
FormLoad.MultiPage1.Value = 2

Set C = Range("A6:AX4500").Find(FormLoad.TxtCaseName3,
LookIn:=xlValues)
If Not C Is Nothing Then
FormLoad.TxtRatRecd3 = C.Offset(0, 1)
End If
End Function

Here is the code Used to Call the Function

Private Sub Found(StrNameFound As String)
Dim sh As Worksheet
Set sh = ActiveSheet
If sh.Name = "Shelter" Then
ShelterLoad (StrNameFound)
ElseIf sh.Name = "Dependency" Then
DependencyLoad (StrNameFound)
ElseIf sh.Name = "TPR" Then
TPRLoad (StrNameFound)
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Load TextBox With Search Result Cell From a PAge

since the code only writes a value if it passes an if test, one would have to
assume that the if test was not passed and the Find command was not
successful. Since you don't have all the arguments specified, it is possible
the defaults are causing the problem.


Turn on the macro recorder

Select the range to search

Manually use Edit=Find to find the value.

Assuming your are successful, turn off the macro recorder and look at the
arguments for the find command that were recorded. Include all those
arguments in your code.

--
Regards,
Tom Ogilvy


" wrote:

When running this It should look for StrName, Then Go 1 box over
(Column b) and Return the data in that cell to FormLoad.TxtRatRecd3
However it Just Stays Blank, any idea why?


Private Function TPRLoad(StrName As String)
FormLoad.TxtCaseName3 = StrName
Dim C As Range
FormLoad.LblName = " TPR Sheet "
FormLoad.MultiPage1.Value = 2

Set C = Range("A6:AX4500").Find(FormLoad.TxtCaseName3,
LookIn:=xlValues)
If Not C Is Nothing Then
FormLoad.TxtRatRecd3 = C.Offset(0, 1)
End If
End Function

Here is the code Used to Call the Function

Private Sub Found(StrNameFound As String)
Dim sh As Worksheet
Set sh = ActiveSheet
If sh.Name = "Shelter" Then
ShelterLoad (StrNameFound)
ElseIf sh.Name = "Dependency" Then
DependencyLoad (StrNameFound)
ElseIf sh.Name = "TPR" Then
TPRLoad (StrNameFound)
End If
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Load TextBox With Search Result Cell From a PAge

On Nov 6, 8:45 am, Tom Ogilvy
wrote:
since the code only writes a value if it passes an if test, one would have to
assume that the if test was not passed and the Find command was not
successful. Since you don't have all the arguments specified, it is possible
the defaults are causing the problem.

Turn on the macro recorder

Select the range to search

Manually use Edit=Find to find the value.

Assuming your are successful, turn off the macro recorder and look at the
arguments for the find command that were recorded. Include all those
arguments in your code.

--
Regards,
Tom Ogilvy



" wrote:
When running this It should look for StrName, Then Go 1 box over
(Column b) and Return the data in that cell to FormLoad.TxtRatRecd3
However it Just Stays Blank, any idea why?


Private Function TPRLoad(StrName As String)
FormLoad.TxtCaseName3 = StrName
Dim C As Range
FormLoad.LblName = " TPR Sheet "
FormLoad.MultiPage1.Value = 2


Set C = Range("A6:AX4500").Find(FormLoad.TxtCaseName3,
LookIn:=xlValues)
If Not C Is Nothing Then
FormLoad.TxtRatRecd3 = C.Offset(0, 1)
End If
End Function


Here is the code Used to Call the Function


Private Sub Found(StrNameFound As String)
Dim sh As Worksheet
Set sh = ActiveSheet
If sh.Name = "Shelter" Then
ShelterLoad (StrNameFound)
ElseIf sh.Name = "Dependency" Then
DependencyLoad (StrNameFound)
ElseIf sh.Name = "TPR" Then
TPRLoad (StrNameFound)
End If
End Sub- Hide quoted text -


- Show quoted text -


What i was doing was Testing From A6 and the text was in a5 :( ty for
the help!!!

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
How calculate a difference btwn 2 TextBox and insert the result inthe appropriate cell John[_34_] Excel Discussion (Misc queries) 4 November 20th 11 02:54 PM
Load ws cell data into a textbox via click on chart datapoint a Charts and Charting in Excel 4 January 23rd 09 08:08 PM
Load Value into textbox Karen53 Excel Programming 2 September 27th 07 11:16 PM
Storing TextBox info in cells, then retrieving on next load-up jlroper[_2_] Excel Programming 2 September 2nd 05 06:09 AM
Storing TextBox info in cells, then retrieving on next load-up T-®ex[_48_] Excel Programming 0 August 31st 05 07:51 AM


All times are GMT +1. The time now is 03:47 AM.

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"