#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default If, then bold row

Hi, i need a macro to bold a row or a range in that row(A:J) if in column A
the macro finds "Nr. Crt.".
Can this be done?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default If, then bold row

Try the below....

Sub Macro()
Dim varFound As Variant, varSearch As Variant, strAddress As String

varSearch = "Nr. Crt."
ActiveSheet.Range("A:A").Font.Bold = False
With ActiveSheet.Columns(1)
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Resize(, 10).Font.Bold = True
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to bold a row or a range in that row(A:J) if in column A
the macro finds "Nr. Crt.".
Can this be done?
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default If, then bold row

Hi Jacob, it's working, but can you make this code to highlight that row? (to
bold and highlight)?
Thanks!

"Jacob Skaria" a scris:

Try the below....

Sub Macro()
Dim varFound As Variant, varSearch As Variant, strAddress As String

varSearch = "Nr. Crt."
ActiveSheet.Range("A:A").Font.Bold = False
With ActiveSheet.Columns(1)
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Resize(, 10).Font.Bold = True
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to bold a row or a range in that row(A:J) if in column A
the macro finds "Nr. Crt.".
Can this be done?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default If, then bold row

Try..

Sub Macro()
Dim varFound As Variant, varSearch As Variant, strAddress As String

varSearch = "Nr. Crt."
ActiveSheet.Range("A:J").Font.Bold = False
ActiveSheet.Range("A:J").Interior.ColorIndex = xlNone
With ActiveSheet.Columns(1)
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Resize(, 10).Font.Bold = True
varFound.Resize(, 10).Interior.ColorIndex = 6
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but can you make this code to highlight that row? (to
bold and highlight)?
Thanks!

"Jacob Skaria" a scris:

Try the below....

Sub Macro()
Dim varFound As Variant, varSearch As Variant, strAddress As String

varSearch = "Nr. Crt."
ActiveSheet.Range("A:A").Font.Bold = False
With ActiveSheet.Columns(1)
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Resize(, 10).Font.Bold = True
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to bold a row or a range in that row(A:J) if in column A
the macro finds "Nr. Crt.".
Can this be done?
Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default If, then bold row

It's working perfect!
Thanks!

"Jacob Skaria" a scris:

Try..

Sub Macro()
Dim varFound As Variant, varSearch As Variant, strAddress As String

varSearch = "Nr. Crt."
ActiveSheet.Range("A:J").Font.Bold = False
ActiveSheet.Range("A:J").Interior.ColorIndex = xlNone
With ActiveSheet.Columns(1)
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Resize(, 10).Font.Bold = True
varFound.Resize(, 10).Interior.ColorIndex = 6
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but can you make this code to highlight that row? (to
bold and highlight)?
Thanks!

"Jacob Skaria" a scris:

Try the below....

Sub Macro()
Dim varFound As Variant, varSearch As Variant, strAddress As String

varSearch = "Nr. Crt."
ActiveSheet.Range("A:A").Font.Bold = False
With ActiveSheet.Columns(1)
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Resize(, 10).Font.Bold = True
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to bold a row or a range in that row(A:J) if in column A
the macro finds "Nr. Crt.".
Can this be done?
Thanks!

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
Alphabetically list of last names: BOLD, not bold Lerner Excel Discussion (Misc queries) 16 March 1st 09 07:46 PM
Alphabetically list of names BOLD and NOT bold Lerner Excel Discussion (Misc queries) 13 March 1st 09 02:37 PM
Bold angie Excel Discussion (Misc queries) 2 August 15th 08 05:07 PM
Bold Row if Col E is bold Cheryl Excel Discussion (Misc queries) 5 December 19th 06 09:11 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM


All times are GMT +1. The time now is 04:23 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"