Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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 to nest a left function within a sumif function? LisaK Excel Worksheet Functions 2 April 23rd 23 11:46 AM
Left Function AJ[_4_] Excel Discussion (Misc queries) 1 April 20th 10 06:01 PM
LEFT function-all to left of a comma? Jennifer F Excel Worksheet Functions 1 January 21st 09 11:19 PM
Left vs Left$ function Andy Excel Discussion (Misc queries) 5 May 6th 07 04:06 AM
HOW DO I NEST THE VLOOKUP FUNCTION WITH THE LEFT FUNCTION CHAIM Excel Worksheet Functions 1 July 27th 05 09:10 PM


All times are GMT +1. The time now is 05:41 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"