Macro acting like double click
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Macro acting like double click
Hello everyone
I have range("A1:A100") and I need for some reason to double click each cell in this range
Select A1 and then double click inside the cell then press enter and do the same with A2 and so on
I know it is weird request but I need it
How to double click the cell using vba ?
I have range("A1:A100") and I need for some reason to double click each cell in this range
Select A1 and then double click inside the cell then press enter and do the same with A2 and so on
I know it is weird request but I need it
How to double click the cell using vba ?
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Macro acting like double click
Do the cells contain formulas or values? If they contain values, a quick way to simulate double-clicking the cells and pressing Enter is
Code: Select all
With Range("A1:A100")
.Value = .Value
End With
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
Thanks a lot Mr. HansV
But I already tested that but it is not the required
I need something like edit mode ..
I have tried your trick before posting the thread but the results were not as expected too .. It is a problem of dealing with dates .. and it is based on regional settings
But I already tested that but it is not the required
I need something like edit mode ..
I have tried your trick before posting the thread but the results were not as expected too .. It is a problem of dealing with dates .. and it is based on regional settings
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
The date are Hijri dates like that
30/9/1437
30/9/1437
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Macro acting like double click
Does this work? (I have no experience with Hijri dates):
Code: Select all
Sub ProcessDates()
Range("A1:A100").TextToColumns DataType:=xlDelimited, _
Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, _
FieldInfo:=Array(1, xlDMYFormat)
End Sub
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
Thanks again Mr. HansV for your reply
It doesn't affect the value to be updated with UDF function. To make the UDF function works well I have to double click each cell in the range
So I was searching for a code that I can loop each cell and double click the cells instead of doing that manually
It doesn't affect the value to be updated with UDF function. To make the UDF function works well I have to double click each cell in the range
So I was searching for a code that I can loop each cell and double click the cells instead of doing that manually
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
No the cells in A1:A100 have Hijri dates and there is UDF function that convert these dates to Gregorian dates ..
The function works well .. the problem is in the dates themselves .. It works well if I double click the cell itself
Thanks a lot for following up the issue
The function works well .. the problem is in the dates themselves .. It works well if I double click the cell itself
Thanks a lot for following up the issue
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Macro acting like double click
How about this?
Code: Select all
Sub ProcessDates()
ActiveSheet.Calculate
End Sub
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
Thanks a lot for all your replies Mr. HansV
In fact I am searching to edit mode each cell to have correct results as I tested your last trick and it has no effect ..
Please guide me how to edit each cell using loops
In fact I am searching to edit mode each cell to have correct results as I tested your last trick and it has no effect ..
Please guide me how to edit each cell using loops
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Macro acting like double click
Could you attach a small sample workbook that contains the UDF and some Hijri dates?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
I can't really upload this workbook and when trying to type similar data with Hijri dates everything is ok ..Even if I copied it to the new workbook it works well
It seems that the problem is that these dates are copied from external source so there's a problem
It seems that the problem is that these dates are copied from external source so there's a problem
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
Thank you very very much for all your great ideas
I tested this and somewhat working for me
Is that right way?
I tested this and somewhat working for me
Code: Select all
Sub Test()
Dim I As Long
For I = 1 To 100
Cells(I, 1).Select
SendKeys "{F2}"
SendKeys "{Enter}"
Next I
End Sub
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Macro acting like double click
SendKeys is notoriously unreliable, but if it works for you, that's fine. You can combine
to
Code: Select all
SendKeys "{F2}"
SendKeys "{Enter}"
Code: Select all
SendKeys "{F2}{Enter}"
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Macro acting like double click
Thank you very much for great help and for your patience
Best and kind regards
Best and kind regards
-
- 3StarLounger
- Posts: 318
- Joined: 23 Aug 2016, 07:43
- Location: Sri Lanka
Re: Macro acting like double click
Yah.. That's true. Per my experiences, Sendkeys method will be depending on device performance, application speed and more... But it's great way for automate some works!HansV wrote:SendKeys is notoriously unreliable
-Sampath-