Forum Discussion
Excel
Sep 01, 2022Iron Contributor
Related to VBA code
Hello everyone,
I want to calculate LEN function of Column K with the help of VBA code.
I have written the code for the function now i want result to displayed in n column can you help me to write code for autofill ?
Here is a attached screenshot :
Please help to what VBA code should i write to autofill it ?
Try this:
Sub Test() Dim m As Long m = Range("K" & Rows.Count).End(xlUp).Row With Range("N2:N" & m) .Formula = "=LEN(K2)-LEN(SUBSTITUTE(K2,"","",""""))" .Value = .Value End With End Sub
5 Replies
Sort By
Try this:
Sub Test() Dim m As Long m = Range("K" & Rows.Count).End(xlUp).Row With Range("N2:N" & m) .Formula = "=LEN(K2)-LEN(SUBSTITUTE(K2,"","",""""))" .Value = .Value End With End Sub
- ExcelIron Contributor
Hello Sir,
How to Autosum of JAN, FEB, MAR and TOTAL EXPENSES of every sheetwith the help of VBA code ?
Please help...
Here is a attached file...
You have asked very similar questions when you were active as Zan or Zain.
Look through your older discussions, you'll find the code you need.