Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Left() function in VB
Hi, I want to populate an array with the first 4 digits of an 8 digi code. But what is the VB syntax for Left(), not Left as a worksheet formula. This is my example: For i = 1 to usedrow Code(i)=Range("a1").offset(i,0).Left( ?, 4) ' What can i writ here Next i Any suggestions will be greatly appreciated -- erikh ----------------------------------------------------------------------- erikhs's Profile: http://www.excelforum.com/member.php...fo&userid=3278 View this thread: http://www.excelforum.com/showthread.php?threadid=56698 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Left() function in VB
Left is a function in VBA, not a method. The format is the
same as for the worksheet function: Code(i) = Left(Range("a1").Offset(i, 0), 4) erikhs wrote: Hi, I want to populate an array with the first 4 digits of an 8 digit code. But what is the VB syntax for Left(), not Left as a worksheet formula. This is my example: For i = 1 to usedrow Code(i)=Range("a1").offset(i,0).Left( ?, 4) ' What can i write here Next i Any suggestions will be greatly appreciated. -- erikhs ------------------------------------------------------------------------ erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788 View this thread: http://www.excelforum.com/showthread...hreadid=566985 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Left() function in VB
Code(1) = left$(range("a1").Offset(i,0),4)
-- Kind regards, Niek Otten Microsoft MVP - Excel "erikhs" wrote in message ... | | Hi, | | I want to populate an array with the first 4 digits of an 8 digit | code. | But what is the VB syntax for Left(), not Left as a worksheet formula. | This is my example: | | For i = 1 to usedrow | Code(i)=Range("a1").offset(i,0).Left( ?, 4) ' What can i write | here | Next i | | Any suggestions will be greatly appreciated. | | | -- | erikhs | ------------------------------------------------------------------------ | erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788 | View this thread: http://www.excelforum.com/showthread...hreadid=566985 | |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Left() function in VB
Works great! Thank you very much -- erikh ----------------------------------------------------------------------- erikhs's Profile: http://www.excelforum.com/member.php...fo&userid=3278 View this thread: http://www.excelforum.com/showthread.php?threadid=56698 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to nest a left function within a sumif function? | Excel Worksheet Functions | |||
Left Function | Excel Discussion (Misc queries) | |||
LEFT function-all to left of a comma? | Excel Worksheet Functions | |||
Left vs Left$ function | Excel Discussion (Misc queries) | |||
HOW DO I NEST THE VLOOKUP FUNCTION WITH THE LEFT FUNCTION | Excel Worksheet Functions |