UDF help to centre and bold

E

Eddy Stan

Hi

sub Banlisting() ' given 2 lines of my macro

Instead of the following two lines, can there be a UDF to center, bold, like
given below

sh1.Cells(rw, 6) = cell.Offset(0, 10) ' Date
sh1.Cells(rw, 6).HorizontalAlignment = xlCenter
sh1.Cells(rw, 6).Font.Bold = True

Is it possible:
CenterAndBold(sh1.Cells(rw, 6)) = cell.Offset(0, 10) ' Date
end sub

Function CenterAndBold(somevalue) ' number, string or date
With Selection
.HorizontalAlignment = xlCenter
.font.bold = True
End With
End Function
 
E

Eddy Stan

HI

I have checked something in the rng and then only i am copy data from sh to
sh1 (ws)
so now for some cells i need to put in bold & color, something like that to
highlight the difference.
so i cannot use "if" in the copying statements, how to do that

Regards,
Stan
 
E

Eddy Stan

sorry my mistake.

see i have data sheet of 4000 rows
i want to pull(copy) for specific entries and show in another sheet
i have put at b1 - one pull down list (validation)
i have put a button in this sheet - "Process"
and stored a list in that.
when the customer is selected in range(b1) and then when pressed "ok" button
then the list is generated. In the list i want specific cells be "bold "
(such as bill number, date, etc.,)

but instead of writing code for each row i want VB code to generate
the list
 

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

Top