Starting with command

  • Thread starter Thread starter Marcus
  • Start date Start date
M

Marcus

Dear all

Is it possible to write an if statement which is
a "starting with command".

For example if cell (r,1) begins "SAM" then
range(A1:d1").select
with selction
Font.bold
end slection

I would want it to pick up a range of data for example

SAM 1
SAM 2
But Not
FAM 1

MAny thanks
 
Hi
try something like

.....
dim r
dim rng as range
r=1
with activesheet
if left(.cells(r,1).value,3)="SAM" then
..range("A1:D1").font.bold=True
end if
end with
.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top