Thank you all particularly KrishnaKumar and Sajan for excellent solutions.
I was in a hurry for the solution and came up with this.
=IFERROR(INDEX($M$2:$M$2218,MATCH(SMALL(IF($L$2:$L$2218 = B2,ABS($M$2:$M$2218-C2)),1),IF($L$2:$L$2218 = B2,ABS($M$2:$M$2218-C2)),0))...
maint7 will be closest. Column B is basically a concatenated field. It is ordered first on the alphanumeric part for example maint, mainz and vaint. Then it is further ordered on the numeric prt. So maint7 will be above maint49 which will b above maint50 which will be above mainz1 , which will...
Can this be done for a text field which is a combination of text and number.? For example I want to search maint5 within maint1 maint7 maint10 vaint2 vaint4.I should get the value maint7 which is closest to maint5. In excel we can assume maint5 is incell a1 and the other value are in cells b1 to...
Can this be done for a text field which is a combination of text and number.? For example I want to search maint5 within maint1 maint7 maint10 vaint2 vaint4.I should get the value maint7 which is closest to maint5. In excel we can assume maint5 is incell a1 and the other value are in cells b1 to...
It is not showing error on that line. The place sheet23 where the data from the stored procedure is retrieved in, does not get refreshed while the script is running. Only after the script has ended sheet23 gets the new data. I tried putting delay code such as sleep and wait etc. But even after...
Sub putval()
Dim Vol_loc, Price_loc, Multi_loc
Dim lsheet As Worksheet
Dim Elem_Vol As Double
Dim Analysis_Period, Multi_Acct As String
Dim Elem_Price As Double
Dim Ctr, Vol_Prd_Ctr, OldSheet, NewSheet As Integer
With ActiveWorkbook.Connections("RPM_Server").OLEDBConnection
.CommandText...
I connect to sql server and run a stored proc. The output is pulled into worksheet "pullsql". From there using vba code I copy pulled info into other worksheets. When in debug mode all works fine. But in run mode the copy into other worksheets does not happen.