ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VLOOKUP (https://www.excelbanter.com/excel-programming/298398-vlookup.html)

Rob H[_4_]

VLOOKUP
 
Hi I am using the following code

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
CrashLoopTest = CrashLoopTest + 1
End If

to Check if the length of a string (with its trailing and leading spaces
removed) is larger than 0, get the string if it is and write it to cell a4
incrementing the value of recounter (which is a cell) by the value of 1.
This is part of the Crashloop process.

I have created another field on the sheet and require the following code to
be added to the above but arent sure where to put it or if it will need
changing to allow it to work.

=VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)

This is what i am manually having to add to each cell when the MainLoopTest
process has finished for each row.

I realise I need to interupt the mainlooptest process and take out the =
from the VLOOKUP statement.

Any Help much appreciated.

btw... I had thought of putting it in as you see below but it just spits
out erorrs saying invalid characters ($) and then requests a list seperator.
Is this because I would use the VLOOKUP function in a different way in the
script rather than on the sheet?

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)
CrashLoopTest = CrashLoopTest + 1
End If






Bob Kilmer[_2_]

VLOOKUP
 
Rob,
SheetN.Range("A6").Formula = "=VLOOKUP(RIGHT(A4,2),
Values!$A1:$B104,2,FALSE)", where SheetN identifies the target worksheet
like Sheet1 or Worksheets("SheetName"), Worksheets(1), etc.
Bob

"Rob H" wrote in message
...
Hi I am using the following code

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
CrashLoopTest = CrashLoopTest + 1
End If

to Check if the length of a string (with its trailing and leading spaces
removed) is larger than 0, get the string if it is and write it to cell a4
incrementing the value of recounter (which is a cell) by the value of 1.
This is part of the Crashloop process.

I have created another field on the sheet and require the following code

to
be added to the above but arent sure where to put it or if it will need
changing to allow it to work.

=VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)

This is what i am manually having to add to each cell when the

MainLoopTest
process has finished for each row.

I realise I need to interupt the mainlooptest process and take out the =
from the VLOOKUP statement.

Any Help much appreciated.

btw... I had thought of putting it in as you see below but it just spits
out erorrs saying invalid characters ($) and then requests a list

seperator.
Is this because I would use the VLOOKUP function in a different way in the
script rather than on the sheet?

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)
CrashLoopTest = CrashLoopTest + 1
End If








Don Guillett[_4_]

VLOOKUP
 
Using the function in vba requires modification
Sub lookupsheet()
'=VLOOKUP(A3,Sheet3!A2:I4,9,FALSE)
MsgBox Application.VLookup([A3], [Sheet3!A2:I4], 9, False)
End Sub

try

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
application.VLOOKUP(RIGHT([A4],2), [Values!$A1:$B104],2,FALSE)
CrashLoopTest = CrashLoopTest + 1
End If


--
Don Guillett
SalesAid Software

"Rob H" wrote in message
...
Hi I am using the following code

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
CrashLoopTest = CrashLoopTest + 1
End If

to Check if the length of a string (with its trailing and leading spaces
removed) is larger than 0, get the string if it is and write it to cell a4
incrementing the value of recounter (which is a cell) by the value of 1.
This is part of the Crashloop process.

I have created another field on the sheet and require the following code

to
be added to the above but arent sure where to put it or if it will need
changing to allow it to work.

=VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)

This is what i am manually having to add to each cell when the

MainLoopTest
process has finished for each row.

I realise I need to interupt the mainlooptest process and take out the =
from the VLOOKUP statement.

Any Help much appreciated.

btw... I had thought of putting it in as you see below but it just spits
out erorrs saying invalid characters ($) and then requests a list

seperator.
Is this because I would use the VLOOKUP function in a different way in the
script rather than on the sheet?

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)
CrashLoopTest = CrashLoopTest + 1
End If








Rob H[_4_]

VLOOKUP
 
Thanks Guys I have got it to work. Good Work.
"Rob H" wrote in message
...
Hi I am using the following code

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
CrashLoopTest = CrashLoopTest + 1
End If

to Check if the length of a string (with its trailing and leading spaces
removed) is larger than 0, get the string if it is and write it to cell a4
incrementing the value of recounter (which is a cell) by the value of 1.
This is part of the Crashloop process.

I have created another field on the sheet and require the following code

to
be added to the above but arent sure where to put it or if it will need
changing to allow it to work.

=VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)

This is what i am manually having to add to each cell when the

MainLoopTest
process has finished for each row.

I realise I need to interupt the mainlooptest process and take out the =
from the VLOOKUP statement.

Any Help much appreciated.

btw... I had thought of putting it in as you see below but it just spits
out erorrs saying invalid characters ($) and then requests a list

seperator.
Is this because I would use the VLOOKUP function in a different way in the
script rather than on the sheet?

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)
CrashLoopTest = CrashLoopTest + 1
End If








Don Guillett[_4_]

VLOOKUP
 
glad to help

--
Don Guillett
SalesAid Software

"Rob H" wrote in message
...
Thanks Guys I have got it to work. Good Work.
"Rob H" wrote in message
...
Hi I am using the following code

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
CrashLoopTest = CrashLoopTest + 1
End If

to Check if the length of a string (with its trailing and leading spaces
removed) is larger than 0, get the string if it is and write it to cell

a4
incrementing the value of recounter (which is a cell) by the value of 1.
This is part of the Crashloop process.

I have created another field on the sheet and require the following code

to
be added to the above but arent sure where to put it or if it will need
changing to allow it to work.

=VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)

This is what i am manually having to add to each cell when the

MainLoopTest
process has finished for each row.

I realise I need to interupt the mainlooptest process and take out the =
from the VLOOKUP statement.

Any Help much appreciated.

btw... I had thought of putting it in as you see below but it just

spits
out erorrs saying invalid characters ($) and then requests a list

seperator.
Is this because I would use the VLOOKUP function in a different way in

the
script rather than on the sheet?

If Len(Trim(.GetText(mainloop, 57, 10))) 0 Then
Range("a4").Offset(CrashLoopTest + reccounter, 0).Value =
Trim(.GetText(mainloop, 57, 10))
VLOOKUP(RIGHT(A4,2), Values!$A1:$B104,2,FALSE)
CrashLoopTest = CrashLoopTest + 1
End If











All times are GMT +1. The time now is 08:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com