Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Molly Brown   on Sep 01 In MS Office Category.

  
Question Answered By: Velma Adams   on Sep 01

Now, if you want to put check  marks in the cells  in col "e" if col "a"
aren't empty then you could try this:

'***********************************************
Sub Fill_Column()
Call ProcessData(True)
End Sub
Function ProcessData(Optional boolCheckMark As Boolean)
Dim rngEnd As Range
Dim CL As Range
Dim rngCl As Range
Const strVal As String = "OX"
Const strCompareCol As String = "A"
Const strFillCol As String = "E"

'get the last used cell  in column  "a"
Set rngEnd = Columns(strCompareCol).Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows)
For Each CL In Range([a1], rngEnd)
Set rngCl = Cells(CL.Row, Columns(strFillCol).Column)
If CL = "" Then
With rngCl
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Value = strVal
End With
ElseIf boolCheckMark Then
Call AddCheckMark(rngCl)
End If
Next CL
End Function

Function AddCheckMark(rngTarget As Range)
With rngTarget
.Font.Name = "Webdings"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Value = "a"
End With
End Function
'********************************************************

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Fill Blank rows Or get search suggestion and latest updates.


Tagged: