Highlighting row when selecting data data via vba

BIGTONE559

Active Member
Joined
Apr 20, 2011
Messages
336
Greetings,

i'm trying to figure out how to highlight a row, and also increase font size of a row where the active cell is. It would also be nice if this macro ran once the file was opened as well.

Data will be in the following range:

B10:O45

i.e. if cell d10 is selected Range(Cells(2,10),Cells(15,10) would be highlighted in yellow with D10 slightly larger than the other cells.

Is this possible? also would be nice if the font of the entire row was bold.


Regards!
 
Perhaps you need to delete the code from the individual sheets leaving just the code in ThisWorkbook.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Perhaps you need to delete the code from the individual sheets leaving just the code in ThisWorkbook.

All Code has been deleted on every worksheet. But what happens is that i have a macro that selects and copys data from B10:O45 on each page.

Code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Not IsNumeric(Application.Match(Sh.Name, Array("Instructions", "PayrollSummary", "EmpLook", "Crew", "Export"), 0)) Then ' list of sheets to exclude
    If Not Intersect(Target, Range("B10:O45")) Is Nothing Then Application.ScreenUpdating = True
End If
End Sub
that's also the range defined in the code that's attached to "thisworkbook". I'm wondering is it possible to turn the code in "thisworkbook" OFF when ever the macro "TestMacro" is run.
 
Last edited:
Upvote 0
Try like this

Code:
Sub TestMacro()
Application.EnableEvents = False
'
'rest of your code
'
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top