About Autofilter Method for Excel

About Autofilter Method for Excel

truewaytw
Enthusiast Enthusiast
951件の閲覧回数
2件の返信
メッセージ1/3

About Autofilter Method for Excel

truewaytw
Enthusiast
Enthusiast

i want take data from excel , use 'find method like follow , i can take one cell ,
but if i want take much data via 'Autofilter like ">5.3" or ">2.3 & <5.5" ,
i don't know how to use 'Autofilter method , can anyone help me !

 

  (setq XlFil "D:\\Excel\\test.xlsx")
  (setq appXl(vlax-get-or-create-object "Excel.Application"))
  (vla-put-visible appXl :vlax-true)
  (setq objBooks(vlax-invoke-method (vlax-get-property appXl 'WorkBooks) 'Open XlFil))
  (setq objSheet(vlax-get-property objBooks 'ActiveSheet))
  (setq aftRange(vlax-get-property objSheet 'Range "D1"))
  (setq objFindRng(vlax-variant-value(vlax-get-property (vlax-get objSheet 'Columns) 'Item "D")))
  (setq objFindCell(vlax-invoke-method objFindRng 'find "5.3" aftRange -4163 2 nil nil))
  (vlax-put-property appXl 'DisplayAlerts :vlax-false)
  (vlax-invoke-method objBooks 'Close)
  (vlax-invoke-method appXl 'Quit)

0 件のいいね
解決済み
952件の閲覧回数
2件の返信
返信 (2)
メッセージ2/3

Ranjit_Singh
Advisor
Advisor
解決済み

Maybe read the data and then filter it using AutoLISP. You would use the Autofilter only if you wish to change the excel file itself. Plus, I don't think you can only read the filtered data (after applying autofilter). The range object will still contain all the cells.

メッセージ3/3

truewaytw
Enthusiast
Enthusiast

ok , i understand , very thanks !

0 件のいいね