hi, experts:请将下面这段vb代码翻译成delphi代码:
for each rowRange in xlSheet.usedrange
for each colRange in rowRange
....
next colRange
next rowRange必感激涕淋!下面两种是错误的:
1. //==============================================================
xlSheet.Used.Range.select();
For rowcnt := 1 to xlSheet.selection.rows.count do
begin
If found = True Then
break; For colcnt := 1 to xlSheet.selection.columns.count do
begin
range := xlSheet.cells(rowcnt, colcnt);
If Range.value = value Then
begin
found := True;
break;
End;
end;
end;2.//===============================================================
For rowcnt := 1 to xlSheet.Used.Range.rows.count do
begin
If found = True Then
break; For colcnt := 1 to xlSheet.Used.Range.columns.count do
begin
range := xlSheet.cells(rowcnt, colcnt);
If Range.value = value Then
begin
found := True;
break;
End;
end;
end;
for each rowRange in xlSheet.usedrange
for each colRange in rowRange
....
next colRange
next rowRange必感激涕淋!下面两种是错误的:
1. //==============================================================
xlSheet.Used.Range.select();
For rowcnt := 1 to xlSheet.selection.rows.count do
begin
If found = True Then
break; For colcnt := 1 to xlSheet.selection.columns.count do
begin
range := xlSheet.cells(rowcnt, colcnt);
If Range.value = value Then
begin
found := True;
break;
End;
end;
end;2.//===============================================================
For rowcnt := 1 to xlSheet.Used.Range.rows.count do
begin
If found = True Then
break; For colcnt := 1 to xlSheet.Used.Range.columns.count do
begin
range := xlSheet.cells(rowcnt, colcnt);
If Range.value = value Then
begin
found := True;
break;
End;
end;
end;
解决方案 »
- 关于函数datediff之类的问题
- AdoQuery向Dbgrid添加数据的问题
- 连接ORACLE数据库出错,高分求助
- 关于进销存及材料库存结转方面的问题!
- 如何使用checkbox把第一张表、第二张表的主键存入第三张表中?
- 问一个问题:AdvStringGrid怎样把几个相邻的格合并呀?
- 如何实现数据的自动刷新?
- 一直很正常,但今天突然发生删除最后一条记录时报错!!!
- 关于多线层问题,急!!
- ·#¥%—*现在最热的Websnap的问题,有高手就进来看一下,说不定有回报呢?*—%¥#·
- 急!!!有谁用过Spreadsheet吗!!怎样进行单元格的读取和赋值呢?烦请高手指点!!进者有分!
- 请高手解决一个难题进来看看就知道了.先谢过了
copyTemplateFile(source, destfileName);
xlsWorkBook := xlApp.Workbooks.Open(destFileName); //打开EXCEL工作簿
xlsWorkSheet := xlsWorkBook.Worksheets[1]; //打开EXCEL工作表改成
For rowcnt := 1 to xlApp.ActiveSheet.used.range.rows.count do
begin //类似单元格行区域
For colcnt := 1 to xlApp.ActiveSheet.used.range.columns.count do
begin
range := xlApp.ActiveSheet.cells(rowcnt, colcnt);
...
end;
end;
后还是错,报ole自动化不支持activeSheet方法...