Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How to i code in VB the Left Function. The user will enter a six character
string in the first column and i need the second column to populate with the first three characters of the first column. Example Column 1 Column 2 ABC100 ABC If i coded it in the worksheet cell B1 , it would be =Left(A1,3), but i want to put in VB as a Worksheet change. Is this possible? Thanks Nathaniel W. Polky =Left(a |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "A1:H10" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target .Offset(0, 1).Value = Left(.Value, 3) End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "Nathaniel W. Polky" wrote in message ... How to i code in VB the Left Function. The user will enter a six character string in the first column and i need the second column to populate with the first three characters of the first column. Example Column 1 Column 2 ABC100 ABC If i coded it in the worksheet cell B1 , it would be =Left(A1,3), but i want to put in VB as a Worksheet change. Is this possible? Thanks Nathaniel W. Polky =Left(a |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to nest a left function within a sumif function? | Excel Worksheet Functions | |||
LEFT function-all to left of a comma? | Excel Worksheet Functions | |||
Left vs Left$ function | Excel Discussion (Misc queries) | |||
Left function | Excel Discussion (Misc queries) | |||
HOW DO I NEST THE VLOOKUP FUNCTION WITH THE LEFT FUNCTION | Excel Worksheet Functions |