![]() |
|
#1
|
|||
|
|||
|
Hi to All
Just stuck with excel and hoping someone can help? The code below allows me to insert (0) between columns G and I just by left double clicking, But i need to extend this to columns V . So it works from columns G to V. I got this formula from another site but don't really understand it but it works Thanks again to all Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("G:I")) Is Nothing Then Exit Sub
Cancel = True
Target.Value = IIf(Target.Value = "", 0, "")
End Sub
Last edited by Pecoflyer; 05-20-2018 at 12:10 AM. Reason: Added code tags |
|
#2
|
|||
|
|||
|
Code:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("G:V")) Is Nothing Then Exit Sub
Cancel = True
Target.Value = IIf(Target.Value = "", 0, "")
End Sub
|
|
#3
|
||||
|
||||
|
@byrner
Hi and welcome to the board. To make code easier to handle on the forum, it's best to wrap it with code tags ( I did it for you on the first post). To accomplish this click " go advanced", elect the code and click the #button. Thanks
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
|
#4
|
|||
|
|||
|
Hi thanks to all , I now have it working Thanks again
Regards |
|
#5
|
|||
|
|||
|
You are welcome.
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How do I insert pictures directly into picture boxes by clicking the box instead of using INSERT>PIC
|
Bree | Word | 1 | 06-24-2016 10:32 PM |
Formula cells are not highlighted when double clicking result
|
hockeytown | Excel | 2 | 12-03-2015 09:57 AM |
Can't open Word files when double-clicking
|
JosieNurse | Word | 9 | 04-21-2015 11:31 AM |
| Problem with page and chapter number appearing when clicking in the scroll bar | Tango Mike | Word | 0 | 05-05-2014 07:12 AM |
Insert the Hyperlink and hide all sheets except clicking Hyperlink
|
PRADEEPB270 | Excel | 1 | 02-22-2013 09:47 AM |