Read first two characters

Closed
torpe - 16 Feb 2012 à 23:00
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 18 Feb 2012 à 22:41
Hello,

I am new at VB and cannot complete a macro so your help will be appreciated.

If I have this data on a worksheet:

A B C
Tue 03Jan12 UC-1201 LA N763CX

Tue 03Jan12 UC-1202 LA N763CX

Tue 03Jan12 UC-1203 LA N763CX

Tue 03Jan12 UC-1204 LA N763CX


Reading file by file I wan to read column B, and if the cell in column B starts by "UC" then copy certain data on a diferent worksheet.

It should be easy but i cannot do it



1 response

venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 811
18 Feb 2012 à 22:41
in the macro (something like this )

if left(range("B1"),2)="UC" then
(other code statements)


end if