0

使用された行のみを取り出す必要がある方法で Excel ファイルを読み取りたいとします。つまり、Excel ファイルに最初に 47 行が含まれていて、10 行しか入力されていない場合、その 10 行のデータを読み取る必要があります (言及したくありません)。読み取り中にA2C7のように、デフォルトでそれを行う必要があります)VB 6.0で達成することは可能ですか.親切にこれを解決するのを手伝ってください.

   Used Range Property has worked for me,but now i found another problem While using this method ,if i add a value in a row after the last used row and remove the value at once and saves the file , it is showing the wrong usedRange value (i.e) it is showing the address of the row where i added and removed the value at once.how to handle this?
4

1 に答える 1

1

行が空でなくなる (使用される) まで、ループを読み取ってみてください。次の構文で使用済み行数を取得できます。

<workbookname>.Sheets("<SheetName>").UsedRange.Rows.Count

例えば

Workbook1.Sheets("Sheet1").UsedRange.Rows.Count
于 2012-06-11T09:36:14.333 に答える