Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-23-2018, 05:34 PM
trevorc trevorc is offline Worksheet_SelectionChange Windows 7 32bit Worksheet_SelectionChange Office 2013
Competent Performer
Worksheet_SelectionChange
 
Join Date: Jan 2017
Posts: 173
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default Worksheet_SelectionChange

Hi All,
I am trying to make the current row being edited highlighted using the selection change event, what I have to do is first save the current row's cell formats (in say A1000:AM1000), then highlight the row, if I stay on that row do nothing and if I select another row restore the previous rows formatting, then highlight the new row.
Is there a way to stop the code from running every time the selection changes or do I need VBA to handle selecting the row to paste the current rows formatting then returning to the selected row, without the code trying to run again.
I have made a start on the code but got stumped debugging the re-running of the code before the sub finished, even in VBA selecting another row fires off the selection change event again. Any help is appreciated.







Code:
'Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'H_Row = Selection.Row
'Range("A" & H_Row, "AL" & H_Row).Select
'   Selection.Copy
'   Range("A70").Select
'   Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'Range("AJ1") = 6 'Selection.Interior.ColorIndex
'End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet_SelectionChange Convert a worksheet_SelectionChange to WorkBook_SheetChange macro sparkle Excel Programming 2 08-03-2014 02:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:52 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