Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-07-2013, 01:17 PM
tmill29 tmill29 is offline Problem with macro Windows 7 64bit Problem with macro Office 2010 64bit
Novice
Problem with macro
 
Join Date: Jun 2013
Posts: 3
tmill29 is on a distinguished road
Default Problem with macro

I have one workbook that contains two sheets. Sheet one has 17 columns and 100k rows. An example of what a row and columns looks like from sheet one:


provcpt1cpt2cpt3cpt4cpt5cpt6cpt7cpt8cpt9cpt10cpt11cpt12cpt13cpt14john doe167L8641101672193301933115172216715000232t84.5536380


Sheet two contains 1 column with 226 various numbers. Example:

PROC_CD
0010
0048T
0051T
0099T
0154T
167

I want the macro to take the 226 proc cds and look for them on sheet 1 and if they find a proc cd within any column and row, highlight the entire row. The code I have is:

Sub HighlightRowsWithMyNumbers()
Dim R As Range, vA As Variant, i As Long, j As Long, k As Long, mynums As Variant
mynums = Sheets("sheet2").Range("a2:a226").Value
Set R = ActiveSheet.UsedRange
vA = R.Value
Application.ScreenUpdating = False
For i = LBound(mynums, 1) To UBound(mynums, 1)
For j = LBound(vA, 1) To UBound(vA, 1)
For k = LBound(vA, 2) To UBound(vA, 2)
If vA(j, k) = mynums(i, 1) Then
R.Cells(j, k).EntireRow.Interior.Color = vbYellow
End If
Exit For
Next k
Next j
Next i


End Sub

It runs with no errors but does not do anything.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with macro Moving data macro problem MattMurdock Excel Programming 1 07-20-2012 04:49 AM
Problem with macro Another simple macro problem Ulodesk Word VBA 1 06-08-2012 06:24 PM
Problem with macro Interesting hyperlink macro problem DobberHockey Word VBA 7 03-26-2012 09:26 PM
Word 2000. Problem with Merriam-Webster Macro M.Hat Word 2 12-29-2011 12:00 PM
Problem with AutoClose macro and Word 2003 cholo Word VBA 0 07-08-2009 05:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft