View Single Post
 
Old 05-19-2018, 04:01 AM
byrner byrner is offline Windows 10 Office 2013
Novice
 
Join Date: May 2018
Posts: 2
byrner is on a distinguished road
Default Insert a number by double Clicking

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
Reply With Quote