Read first two characters

[Closed]
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
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 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
803
in the macro (something like this )

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


end if