Reversing Macro
Reversing Macro

Excel macro discussed reverse?
Well, I want to be able to create a macro to take a number and then determine what combination a list of numbers to add up. For example (simplified): 23 12 45 65 32 21 43 76 56 61 Which combination of these figures added to 121? " (45, 12, 21, 43) I need the macro to evaluate a list that may change each time (ie the GSG can be 4 numbers once, and 12 questions the next time). I am not interested in multiple answers that the number tested range of 0.01 to 99999.99 Thanks!
Well, here in my it. Macro below assumes that your list of issues through research is in column A from A1 and the number you want to find a result in cell B1. Find the first combination of numbers that add a column to the value in B1, then stops. The combination may or may not be the least of numbers. Only is the first combination of the value in A1. In the list above will give the macro is 23, 12, 65, 21 for a total of 121. The results are presented in a message box that you have not specified how he wanted the result. Note: If you have a long list of numbers too can enjoy the macro take a long time to explore all possible combinations. Option Explicit Dim As String Dim As Double Sun sSolution As Boolean Sub dEndResult bFound Reverse_Sum () rList attenuated as "rList Set range = Range (" A1 ") dEndResult = Range (" B1 "). Value 'Set rList = Range (rList, rList.End (xlDown)) bFound' = False Call iterate (rList, 0, "") 'If Then bFound sSolution = right (sSolution, Len (sSolution) – 2) MsgBox sSolution, Title: = "The combination of "& dEndResult Else MsgBox" No combination found. "Title: =" Combining "and dEndResult End If End Sub Private Sub iterate (rList As Range, SubTot As Double, i SubSolution As String) 'Dim Dim dTotal Double As Integer For i = 1 TB = + rList.Count dTotal SubTot rList dTotal dEndResult (I) = If = Then sSolution SubSolution & "" & CStr (rList (i)) = True Exit For bFound dTotal dEndResult "ElseIf Y <i After rList.Count Call iterate (Range (rList (i + 1), rList (rList.Count)), dTotal, SubSolution & "" & CStr (rList (i))) Then Exit For End If If bFound Next i End Sub
European stocks dip on U.S. recovery issues * FTSEurofirst 300 falls 0.3 PCT, show a monthly increase
| | Fotodiox 58mm Filter Thread Lens, Macro Reverse Ring Camera Mount Adapter for Canon EOS 1d,1ds,Mark II, III, IV, 5D, Mark II, 7D, 10D, 20D, 30D, 40D, 50D, 60D, Digital Rebel xt, xti, xs, xsi, t1i, t2i, 300D, 350D, 400D, 450D, 500D, 550D, 1000D $6.75 By mounting the lens backward on a camera body, you can create amazing macro images. It is extremely fun to turn you lens into a macro lens…. |
| | Fotodiox 52mm Filter Thread Lens, Macro Reverse Ring Camera Mount Adapter, for Nikon D1, D2, D3, D3x,D3s, D100, D200, D300, D300s, D700, D40, D40x, D50, D60, D70, D70s, D80, D90, D3000, D3100, D5000, D7000 $7.95 By mounting the lens backward on a camera body, you can create amazing macro images. It is extremely fun to turn you lens into a macro lens…. |
| | Minolta MC Macro Rokkor-X 50mm F3.5 Lens Original Box Case Reverse Ring RARE $169.96 |
| | Minolta MC ROKKOR QF 50mm f/3.5 MACRO w Case, Ext. Tube, Reverse Mount MINT Cond $135.00 |
| | Minolta MC MACRO ROKKOR 50mm f/3.5 with Case, Extension Tube, Reverse Mount $139.50 |
| | Kiron Minolta Reverse Adapter Ring 55mm for Macro Work $84.96 |
| | TOPCON/EXAKTA 49MM LENS REVERSE ADAPTER RING.for macro. $69.00 |
| | Olympus OM Reverse Adapter Ring 49mm for Macro Work $67.96 |
| | Pentacon Six + MACRO+ Reverse 67mm to Canon EOS Adapter $49.98 |
| | NIKON F BR 2 REVERSE ADAPTER RING /52MM MACRO/CLOSE UP $59.99 |
| | Pentacon Six + MACRO+ Reverse 62mm to Canon EOS Adapter $47.49 |
| | Pentacon Six + MACRO+ Reverse 67mm to Canon EOS Adapter $47.49 |
| | Pentacon Six + MACRO + Reverse 62mm to Nikon Adapter $47.49 |
| | Pentacon Six + MACRO + Reverse 67mm to Nikon Adapter $47.49 |
| | PENTAX BAYONET 49MM LENS REVERSE ADAPTER RING 4 MACRO. $59.00 |
| | TOPCOR TOPCON 62MM REVERSE RING FOR MACRO/CLOSEUP PHOTO $49.99 |
| | Nikon F Nikkor BR3 lens adapter macro genuine reversing $49.99 |
| | 12 Metal Reverse Mount Macro Lens Adapter for CANON EOS $49.00 |
| | Nikon BR-2A Lens Reversing Ring Macro Adapter 52mm BR2A OEM $39.99 |
| | Nikon BR-3 Macro Adapter Ring 52mm Filter Reverse Lens *USA Authorized Dealer* $44.95 |
| | Genuine PENTAX M42 Macro Reverse Ring 49mm Excellent! $34.00 |
| | Genuine PENTAX M42 Macro Reverse Ring 49mm $34.00 |
| | MINOLTA MC MACRO ROKKOR – QF 1:35 f = 50mm & 1:1 Adapter/Reversing Ring MINT $28.00 |
| | Asahi Pentax Reverse Adapter 49mm to 6×7 camera body Macro Ring **NEW** $29.00 |
| | TOPCON 62MM REVERSE RING FOR MACRO/CLOSEUP PHOTO $39.99 |
| | 10 Metal Reverse Mount Macro Adapter for CANON EOS $39.95 |
| | 52mm Macro Reverse Mount Ring Adapter,Canon EOS w/Focus $34.95 |
| | 58mm Macro Reverse Mount Ring Adapter,Canon EOS w/Focus $34.95 |
| | Rollei Retro E49 49mm Reverse Mount Macro Lens Adapter $33.96 |
| | Genuine Nikon BR-2 reversing ring close up macro adapter – very nice – E026 $29.99 |
| | GENUINE Nikon BR-2A Lens Macro Reversing Ring 50mm f1.4 $28.90 |
| | Nikon BR-2 Nikon BR-2 Macro Reversing Adapter 52mm $25.00 |
| | BR2 Macro Reversing Ring – 52mm Male thread & Nikon F $25.00 |
| | Nikon BR2 Macro Reversing Ring adapter in box – Nice Mint-! $20.00 |
| | Reverse Adapter Ring -Extreme MACRO for Pentax K-x,K20D $21.95 |
| | Reverse Adapter Ring -Extreme MACRO for Pentax K 52mm $21.95 |
| | Kalt MACRO REVERSE ADAPTER RING Canon to 52 mm – NEW $20.92 |
| | Dot Line MACRO REVERSE ADAPTER RING Nikon – 52 mm – NEW $20.92 |
| | Canon EOS EF Mount 58mm Close Up Macro Reverse Adapter $19.70 |
| | Canon EOS EF Mount 58mm Close Up Reversing Macro Ring $19.70 |
| | Canon EOS EF Mount 52mm Close Up Macro Reverse Adapter $19.70 |
| | QUALITY MINOLTA 55mm KIRON MD REVERSE MATE ADAPTER MACRO JAPAN $19.99 |