dfolzenlogen
New Member
- Joined
- Oct 18, 2009
- Messages
- 36
Does anyone have any suggestions for me?
I have multiple worksheets in my workbook
each worksheet contains 2 columns with text in Column A, numbers in Column B
The length of the columns vary from worksheet to worksheet
The last entry in Column A is always "Total pages"
The last cell in Column B is always empty and on same row as "Total pages" in Column A
I want to loop through all Worksheets to find "Total pages" and replace it with "TOTAL:" , align the text right and make it bold
I then want to move 1 column to the right (using Offset?) to Column B on the same row and autosum all the numbers above that cell, that row.
I then want to make the autosum cell bold and put border of single line on top and double row on bottom (accounting total?)
I found the following code and it gets me as far as looping through all the worksheets using Find and Replace
I added the following to the code but I do not see any results. What am I doing wrong?
I hope I'm on the right track.
Thanks.
I have multiple worksheets in my workbook
each worksheet contains 2 columns with text in Column A, numbers in Column B
The length of the columns vary from worksheet to worksheet
The last entry in Column A is always "Total pages"
The last cell in Column B is always empty and on same row as "Total pages" in Column A
I want to loop through all Worksheets to find "Total pages" and replace it with "TOTAL:" , align the text right and make it bold
I then want to move 1 column to the right (using Offset?) to Column B on the same row and autosum all the numbers above that cell, that row.
I then want to make the autosum cell bold and put border of single line on top and double row on bottom (accounting total?)
I found the following code and it gets me as far as looping through all the worksheets using Find and Replace
Code:
Sub test()
Dim ws As Worksheet
For Each ws In Worksheets
With ws
.Cells.Replace What:="Total", Replacement:="TOTAL:", LookAt:= _
xlWhole, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End With
Next ws
End Sub
I added the following to the code but I do not see any results. What am I doing wrong?
Code:
Sub test()
Dim ws As Worksheet
For Each ws In Worksheets
With ws
.Cells.Replace What:="Total", Replacement:="TOTAL:", LookAt:= _
xlWhole, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Activate
ActiveCell.Font.Bold = True
ActiveCell.Offset(0, 1).Select
ActiveCell.Font.Bold = True
End With
Next ws
End Sub
I hope I'm on the right track.
Thanks.