Input box question -

  • Thread starter Thread starter Annette
  • Start date Start date
A

Annette

I started my input box and am stumped on trying to finish. I want to be
able to have the user enter a number and when the user clicks okay, the
result is that the macro will run through the spreadsheet and bold all the
numbers that match the number the the user entered.

But so far, this is all I have got! (Pretty bad because I haven't even told
it the range and the range is from A to G - help!)

Dnum = InputBox("Enter Customer ID")
If Dnum <> "" Then
cell.font.Bold = True
End If
 
Hi Annette
one way:
sub foo()
dim rng as range
dim cell as range
dim DNum

set rng = activesheet.range("A1:D100")
Dnum = InputBox("Enter Customer ID")
If Dnum = "" Then
exit sub
end if

for each cell in rng
if cell.value = Dnum then
cell.font.bold = True
end if
next
end sub
 
Yes sireeeeeeeeeeeeeeeee ... it works tons better when you describe a range
.... Thanks, Frank ... again!
 

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

Similar Threads


Back
Top