Sunday, September 18, 2016

[Solution] change row color on double click

change row color on double click

When double click in row B, i need to highlight the same row from B:M.

When double clicked again, i need to remove the highlight.

 
Example code that works partially is below.

(I altered it to not put words in the cell - which i dont need here, but couldnt get it to remove the highlight after the second double click)
 
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
 Dim RngToInspect As Range

     If Target.Cells.Count > 1 Then
         Exit Sub 'one cell at a time
     End If
 
     Set RngToInspect = Me.Range("B1").EntireColumn
 
     If Intersect(Target, RngToInspect) Is Nothing Then
         Exit Sub
     End If

     Application.EnableEvents = False 'just in case
     With Target
         If LCase(Target.Value) = LCase("RLSD") Then
             'wipe it out
             .Value = ""
             .EntireRow.Range("B1:M1").Interior.ColorIndex = xlNone
         Else
            ' .Value = "RLSD"
             .EntireRow.Range("B1:M1").Interior.ColorIndex = 17
         End If
     End With
     Application.EnableEvents = True

     'stop rightclick menu from appearing
     Cancel = True
End Sub

Anwsers to the Problem change row color on double click

Download SmartPCFixer to Fix It (Free)

Hi,
 
Maybe this.
Note I think the way this code is written is an odd way of doing things but if it works for you then fine.
 
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim RngToInspect As Range
If Target.Cells.Count > 1 Then
    Exit Sub 'one cell at a time
End If
Set RngToInspect = Me.Range("B1").EntireColumn
If Intersect(Target, RngToInspect) Is Nothing Then
    Exit Sub
End If
Application.EnableEvents = False 'just in case
With Target
    If LCase(Target.Value) = LCase("RLSD") Then
        'wipe it out
        .Value = ""
       If Target.Interior.ColorIndex = 17 Then
            .EntireRow.Range("B1:M1").Interior.ColorIndex = xlNone
        Else
            .EntireRow.Range("B1:M1").Interior.ColorIndex = 17
        End If
    Else
        ' .Value = "RLSD"
        If Target.Interior.ColorIndex = 17 Then
            .EntireRow.Range("B1:M1").Interior.ColorIndex = xlNone
        Else
            .EntireRow.Range("B1:M1").Interior.ColorIndex = 17
        End If
    End If
End With
Application.EnableEvents = True
'stop rightclick menu from appearing
Cancel = True
End Sub

Run CHKDSK
  • Go to the Start button.
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.

Another Safe way to Fix the Problem: change row color on double click:

How to Fix change row color on double click with SmartPCFixer?

1. You can Download SmartPCFixer here. Install it on your system. When you open SmartPCFixer, it will perform a scan.

2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.

3. The Repair part is finished, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in this software. Like dll downloading, windows updating and print spooler error repair.


Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.8.0.43.0,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: Checking for Numlock status, fixing Numlock status [Anwsered],Troubleshooter of Error: cant install itunes,Fast Solution to Error: changing dynamic hard drives to static hard drives,Troubleshoot:Charms bar Settings menu closed down Also, LifeCam does not work.,How Can I Fix - Chrome installation issue due to compatiblity?,Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver

No comments:

Post a Comment