Help with code

N

nowhereman

i have a task list which i use to list and schedule several modules of a
project

column "c" contains all the data for the individual task while column
"e" has text describing the status.

i have a macro attached to a control button which will allow me to select
a cell in column "C" the click the button and my macro will change the
background color in the cell in column "C" and insert the text
"COMPLETE" in the adjacent cell in column "E"

what i would like to do is to be able to select a range of cells in
column "C" and have the same action happen to all the rows that are
selected. The selection will always be different ie sometimes may select
3 rows, another 10 rows, while another may only be 1 and so forth.

i am just learning a wee bit of programing and the help i have received
it the NG i am very thankful for.

Here is my code so far . i can get the color change to work in all the
selected rows, but the text insert only works in the first row

Sub COMPLETE()
'
' COMPLETE Macro
'

'
StartRow = ActiveCell.Row

With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 10092543
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Offset(0, 2).Range("A1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.Select
ActiveCell.FormulaR1C1 = "COMPLETE"
With ActiveCell.Characters(Start:=1, Length:=8).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
ActiveCell.Offset(1, -2).Range("A1").Select
End Sub

TIA for any help you may have to offer
i appreciate all the effort you extend to help myself and others in the
NG

NWM
 
G

Guest

Sub COMPLETE()
'
' COMPLETE Macro
'

'
StartRow = ActiveCell.Row

With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 10092543
.TintAndShade = 0
.PatternTintAndShade = 0
End With

For Each cell In Selection.Offset(0, 2)
With cell
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
.FormulaR1C1 = "COMPLETE"
With .Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
End With
Next
End Sub
 
N

nowhereman

in
THANK YOU so very much
i really appreciate your help ..... it is really exciting for me to be
able to not only accomplish the task at hand, but to learn a bit more
about the codes, macros, and how they work....

best wishes

nwm


Sub COMPLETE()
 

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