Public Function CalcMoney(carType As Range, timeType As Range, carItems As Range, timeItems As Range, timeValue As Range, others As Range)
Dim temp
Dim unitValue
Dim timeTemp
'先匹配出车型的列index
temp = Application.Match(carType, carItems, 0)
'匹配出车型所对应的机油、机油格数据
unitValue = Application.Index(others, 0, temp + 1)
timeTemp = Application.Match(timeType, timeItems, 0)
'计算总结果
CalcMoney = Application.Sum(unitValue) + Application.Index(timeValue, timeTemp, temp)
'CalcMoney = SUM(INDEX(C5:AF6,0,MATCH($A$22,C3:AF3,0)+1))+INDEX(C18:AF21,MATCH($B$22,$B$18:$B$21,0),MATCH($A$22,C3:AF3,0))
End Function
Sub calc()
Dim result
Dim carItems()
Dim timeItems()
Dim timeValue()
Dim others()
Dim carType
Dim timeType
timeType = Range("$B$22")
carType = Range("$A$22")
carItems = Range("C3:AF3")
timeItems = Range("$B$18:$B$21")
timeValue = Range("C18:AF21")
others = Range("C5:AF6")
result = CalcMoney(carType, timeType, carItems, timeItems, timeValue, others)
MsgBox result
End Sub
分享到:
相关推荐
解决大批量数据导出Excel产生内存溢出的方案 在大批量数据导出Excel时,经常会遇到内存溢出的问题。这是因为POI或JXL在导出大量数据时,将每一个单元格生成一个Cell对象,从而导致内存溢出。解决这个问题的唯一方法...
Quickly summarize millions of records with Pivot Tables Perform ad hoc analyses with slicers and other filters Create advanced data mashups with Power Pivot Solve complex problems with What-If, ...
This TscExcelExport component is an advanced, powerful but easy to use component which enables you to export all records of a dataset from Embarcadero Delphi to Microsoft Excel. Many features are ...
将数据集输出到Excel 97/2000/2002Export all records of a dataset to MS Excel (97, 2000 or XP).PropertiesName of worksheet and file Header texts Begin row of header, titles (=fieldnames) and data (field...
This TscExcelExport component is an advanced, powerfull but easy component to export all records of a dataset from Delphi to MS Excel (97, 2000, XP or 2003). Many features are provided to change the ...
import_excel_mysql_pandas 该项目使用Python Pandas将Excel文件导入MySQL。 然后,以编程方式将电子表格分为2个单独的工作表...df = pd.read_excel(“ C:\ Users \ user \ Desktop \ python-files \ 100 Records2.xl
导入导出、合并单元格处理代码示例 jar包解决导出Excel 出现的问题:Warning: Maximum number of format records exceeded. Using default format.
you can add & view records. It is automatically generate on EXCEL, MSWORD, NOTEPAD and also to any other office encoder. How to change extension format files LIKE .csv .doc .txt
提倡共享精神.需要什么破解版的控件可以站内站我....Designed from start to make full use of modern Delphi features like records with methods or generics. Also available as a fully managed .NET library
This TscExcelExport component is an advanced, powerful but easy to use component which enables you to export all records of a dataset from Embarcadero Delphi to Microsoft Excel. Many features are ...
Added Excel exporter (both xls and xlsx support) Support has been added for Oracle12c extended strings (> 4000 bytes) The align button has a new Hide editor option to show only the result set The ...
This TscExcelExport component is an advanced, powerful but easy to use component which enables you to export all records of a dataset from Borland/Codegear/Embarcadero Delphi to Microsoft Excel....
matlab导入excel代码utl_parsing_a_complex_nested_json_file_using_r_lists 使用r列表解析复杂的嵌套json文件。 关键字:sas sql join合并大数据分析宏oracle teradata ...records? with detailed stats
When exporting more records they had no displayformat. Now displayformat for each block of rows is set. This will also increase the file size ! - Added resource strings for the exceptions. Now ...
- Filter the records where Status is 'Open'; - Filter the records where Type is 'WI5'; - Filter the records where WIID is less than 500000; - Append the resulting datatable into an Excel ...
Create Python applications to find specific records, group data, and parse text files Build statistical graphs and plots with matplotlib, pandas, ggplot, and seaborn Produce summary statistics, and ...
0.30 alpha( JustHoldYourNoseAndVoteForJoeBiden ),作者:Ray Arias BloodHealthRecordSpreadsheet v.0.30 alpha(代号: JustHoldYourNoseAndVoteForJoeBiden )于2020年10月26日发布:一种Excel表,用于高效地...
-Paging- Admin can specify whether to use paging on the grid and how many records to show per page. -Export datagrid to an Excel file. -Parameter Substitution: SQL can include [dnn:UserID] or [dnn:...
- Excel Worksheet Naming and Page Naming - External Image Sources - Language Localization - Creating a Checkbox List To Show Existing Records - Using a Checkbox List To Select and Deselect Records - ...