ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search column...change row to BOLD (https://www.excelbanter.com/excel-programming/430064-re-search-column-change-row-bold.html)

Don Guillett

Search column...change row to BOLD
 

As ALWAYS, post YOUR code for comments and suggestions. Also, please tell us
your definition of a whole number. Examples

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mike" wrote in message
...
I'm an amateur excel user and I've just taught myself how to create a
macro.
I have a bid program that I export a summary sheet to excel. I've set up
a
macro to format column widths and column colors. I want to add to this
macro
to search column A for WHOLE numbers. If the cell in column A is a whole
number, then I want to change that row to bold. Help please?



Mike

Search column...change row to BOLD
 
Don, Here's the macro I have set up so far.
Sub Merge_Cells()
'
' Merge_Cells Macro
' Merge Cells for Cost Summary
'

'
Columns("C:D").Select
Selection.Delete Shift:=xlToLeft
Rows("2:2").Select
Selection.Insert Shift:=xlDown
Range("A1:A2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("C1:C2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("D1:D2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("F1:F2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("G1:G2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("H1:H2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("I1:I2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("J1:J2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("K1:K2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("L1:L2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("M1:M2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("N1:N2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Columns("A:A").Select
Selection.ColumnWidth = 7.57
Columns("B:B").Select
Selection.ColumnWidth = 35.29
Columns("C:C").Select
Selection.ColumnWidth = 12.14
Columns("D:D").Select
Selection.ColumnWidth = 6.71
Columns("E:E").Select
Selection.ColumnWidth = 10.43
Columns("F:F").Select
Selection.ColumnWidth = 14
Columns("G:G").Select
Selection.ColumnWidth = 11.43
Columns("H:H").Select
Selection.ColumnWidth = 12.71
Columns("I:I").Select
Selection.ColumnWidth = 11.71
Columns("J:J").Select
Selection.ColumnWidth = 12
Columns("K:K").Select
Selection.ColumnWidth = 15
Columns("L:L").Select
Selection.ColumnWidth = 17.57
Columns("M:M").Select
Selection.ColumnWidth = 13.14
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
Columns("N:N").Select
Selection.ColumnWidth = 11.86
Columns("N:N").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Columns("L:L").Select
With Selection.Interior
.ColorIndex = 34
.Pattern = xlSolid
End With
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaper11x17
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With

End Sub


This was made using the "Record New Macro" option from the tools menu. An
example that I have would include something like the following. Cell A13 =
1, Cell 14 = 1.1, Cell 15 = 2, Cell 16 = 2.1. In this case, I want to make
rows 13 and 15 bold. I need to search for whole numbers as the data varies
from one job to the next.

Thanks again.
"Don Guillett" wrote:


As ALWAYS, post YOUR code for comments and suggestions. Also, please tell us
your definition of a whole number. Examples

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mike" wrote in message
...
I'm an amateur excel user and I've just taught myself how to create a
macro.
I have a bid program that I export a summary sheet to excel. I've set up
a
macro to format column widths and column colors. I want to add to this
macro
to search column A for WHOLE numbers. If the cell in column A is a whole
number, then I want to change that row to bold. Help please?





All times are GMT +1. The time now is 01:18 AM.

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