Solved

Adjustment to display words in the center of the cell.

Posted on 2016-09-27
2
36 Views
Last Modified: 2016-09-28
Hello Expert Exchange helpers and users. I have this code that labels the task with a number, so that it may show me what is the order all the task, i would like to add an additional rule to have it display in the center of the cell when being display.

Sub FindAndPlaceValuesInColumnC()
Dim lr As Long
Dim rng As Range, cell As Range
Application.ScreenUpdating = False
Application.EnableEvents = False
lr = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
ActiveSheet.ListObjects("Table134").Range.AutoFilter field:=7, Criteria1:="1"
If Range("G4:G" & lr).SpecialCells(xlCellTypeVisible).Cells.Count > 1 Then
   Set rng = Range("F5:F" & lr).SpecialCells(xlCellTypeVisible)
   For Each cell In rng
      Cells(cell.Row, "J") = Trim(Replace(cell.Value, "*", ""))
   Next cell
End If
ActiveSheet.ListObjects("Table134").Range.AutoFilter field:=7
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

Open in new window


organize-it.pngorganize-it-2.pngBK-TO-DO-LIST.xlsm
0
Comment
Question by:Omar Hernandez
2 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
Comment Utility
Find your own line and add 2 lines:

Cells(cell.Row, "J") = Trim(Replace(cell.Value, "*", ""))
Cells(cell.Row, "J").HorizontalAlignment = xlCenter
Cells(cell.Row, "J").VerticalAlignment = xlCenter

Open in new window

0
 

Author Closing Comment

by:Omar Hernandez
Comment Utility
Thanks a mil Kimputer, works like a charm...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now