Solved

Adjustment to display words in the center of the cell.

Posted on 2016-09-27
2
45 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
ID: 41819344
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
ID: 41820976
Thanks a mil Kimputer, works like a charm...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

895 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

12 Experts available now in Live!

Get 1:1 Help Now