ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add cells with a specific format? (https://www.excelbanter.com/excel-programming/345378-add-cells-specific-format.html)

qwery

Add cells with a specific format?
 
how can I add cells into another cell only if the format is right in the cell
I want to add

Tom Ogilvy

Add cells with a specific format?
 
for each cell in Range("A1:A10")
if cell.Numberformat = "#,##0.00 then
tot = tot + cell.Value
end if
Next

Range("B11").Value = tot

--
Regards,
Tom Ogilvy




"qwery" wrote in message
...
how can I add cells into another cell only if the format is right in the

cell
I want to add




Bob Phillips[_6_]

Add cells with a specific format?
 
Well, there are many types of format, so you may need to be more explicit,
but this adds it if it is bold

For Each cell In Selection
If cell.Font.Bold Then
Range("H1").value = Range("H1").value + cell.Value
End If
Next cell

--

HTH

RP
(remove nothere from the email address if mailing direct)


"qwery" wrote in message
...
how can I add cells into another cell only if the format is right in the

cell
I want to add





All times are GMT +1. The time now is 07:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com