最新評論

Need some help with logic. I wanted to check the first cell for data if it has data then it will return that cell; if it doesn't have data then it will return a different cell. But if the second cell is blank then it should return a msg. Can you please help.

Hello I'm here asking for your help. My research ended up in 2 different macros that combined will give a good utility for my work.
1. Will insert image as comment, 2. Will fetch Hyperlinks(Local folder path only, not web based URL) and paste them in destination cell
I really tried to combine them to do one job, but I guess I don’t have enough knowledge on this.
I need the images to be inserted as comment as the 1st code does to the destination range user selects.

I have an own set of formula combinations to convert numbers from 0 (zero) to 9999999 (Ninety Nine Lakhs Ninety Nine Thousand Nine Hundred Ninety Nine).

(This number is the upper limit for my method. It will return an error for any number out of this range). Secondly, as it is Excel formula based method, only one cell can be converted at a time.
Send your request to shreepadg at the rate gmail dot com

@MHi,
If there are merged cells in the specified range, please try the following code.

Dim mRg As Range
Dim mStr As String

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Range("A1:F8"), Target) Is Nothing Then
Set mRg = Target.Item(1)
mStr = mRg.Value
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range
On Error Resume Next
Set xRg = Intersect(Range("A1:F8"), Target)
If xRg Is Nothing Then Exit Sub
Target.Worksheet.Unprotect Password:="123"
If xRg.Value <> mStr Then xRg.MergeArea.Locked = True
Target.Worksheet.Protect Password:="123"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Range("A1:F8"), Target) Is Nothing Then
Set mRg = Target.Item(1)
mStr = mRg.Value
End If
End Sub