LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Simplifying VBA code

I actually have a couple of questions:

I have a workbook with 2 worksheets in it. On worksheet2 is a list of names,
unformatted and raw. The list exists simply to be a list that can be updated,
but has no purpose other than that. On worksheet 1 I have a schedule of
sorts. I have been recording a macro to find and format the names from the
list on worksheet2. Here is the code I have:
Sub proline()
'
' proline Macro
' Macro recorded 11/2/2004 by SGAUER
'

'
Cells.Find(What:="anix", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
End With
Selection.Font.Bold = True
Cells.Find(What:="bach", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
End With
Selection.Font.Bold = True
Cells.Find(What:="buck", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
End With
Selection.Font.Bold = True
Cells.Find(What:="bwoo", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
End With
Selection.Font.Bold = True
ActiveWindow.ScrollRow = 1
Range("A1").Select
End Sub

How do I simplify it and write a next code so that it will automatically
read from the list and format the names accordingly on worksheet 1?

Thanks for your help,
Steve
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help simplifying VBA code jlclyde Excel Discussion (Misc queries) 4 September 4th 08 04:21 PM
Code needs simplifying Sandy Excel Worksheet Functions 5 April 26th 07 01:31 PM
Simplifying VBA code Michael M Excel Worksheet Functions 8 January 24th 07 02:17 PM
Simplifying formula m.cain Excel Discussion (Misc queries) 1 March 24th 06 11:35 AM
Simplifying code using array John Pierce Excel Programming 3 December 15th 03 03:17 AM


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"