C
camron107
i have created a user input form in VBA, which works fine.
"organisation" is a field on the form
if a user enters an organisation beggining with letters A-F for example, i want the data entered to go into sheet 1. if the organisation begins with G-L, i want it to go into sheet 2 etc...
i have managed such a formula in excel, but does not work in VB.
my current attempt looks like this:
If Organisation.Value(Left >= CHAR(65), Left <= CHAR(70)) Then
ActiveWorkbook.Sheets("sheet1").Activate
Range("A2").Select
ElseIf Organisation.Value(Left >= CHAR(71), Left <= CHAR(76)) Then
ActiveWorkbook.Sheets("Sheet2").Activate
Range("A2").Select
Thank you for your help and time, it is much appreciated.
"organisation" is a field on the form
if a user enters an organisation beggining with letters A-F for example, i want the data entered to go into sheet 1. if the organisation begins with G-L, i want it to go into sheet 2 etc...
i have managed such a formula in excel, but does not work in VB.
my current attempt looks like this:
If Organisation.Value(Left >= CHAR(65), Left <= CHAR(70)) Then
ActiveWorkbook.Sheets("sheet1").Activate
Range("A2").Select
ElseIf Organisation.Value(Left >= CHAR(71), Left <= CHAR(76)) Then
ActiveWorkbook.Sheets("Sheet2").Activate
Range("A2").Select
Thank you for your help and time, it is much appreciated.