#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default add column

hi,

I have a sheet withi like 500 or so rows. There is a column B with some of
the values in Bold. I would like to add a column to the sheet which puts a
"BOLD" in each row/column if the value in column B is bolded, and a value of
"NOT" if it is not bolded. Is there a programmatic/fast way of doing this?

Thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default add column

Sub boldchk()
n = Cells(Rows.Count, 2).End(xlUp).Row
Range("C1").EntireColumn.Insert
For i = 1 To n
If Cells(i, 2).Font.Bold = True Then
Cells(i, 3).Value = "BOLD"
Else
Cells(i, 3).Value = "NOT"
End If
Next
End Sub
--
Gary''s Student
gsnu200708


"geebee" wrote:

hi,

I have a sheet withi like 500 or so rows. There is a column B with some of
the values in Bold. I would like to add a column to the sheet which puts a
"BOLD" in each row/column if the value in column B is bolded, and a value of
"NOT" if it is not bolded. Is there a programmatic/fast way of doing this?

Thanks in advance,
geebee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default add column

Sub macro1()
Dim c As Range
Dim rng As Range

Set rng = Sheets("Sheet1").Range("B1:B500")
For Each c In rng
If c.Font.FontStyle = "Bold" Then
Sheets("Sheet1").Range("H" & c.Row) = "BOLD"
Else
Sheets("Sheet1").Range("H" & c.Row) = "NOT"
End If
Next c
End Sub

Change row numbers and columns to suit.

Hth,
Merjet


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
divide column(x) by column(y) to give column(x/y) in excel? James New Users to Excel 2 April 24th 23 11:46 AM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Programming 2 December 30th 06 06:23 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
How can i have all alike product codes in column A be matched with like cities in column B and then add the totals that are in column C [email protected] Excel Programming 4 August 2nd 06 01:10 AM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"