Page 1 of 1
Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 8:15 am
by Marc Vanzegbroeck
Hi,
In my program I put conditional formating, and also formuls on cells in excel.
The problem is that I don't have to put it on all the cells (so I can use range).
So what I do now is put is on each cell that need it, the condition.
The problem is that it take a link time (35sec)
I was thinking to do a multiple select, and put than only 1 time tteh condition on it.
How can I select multiple cells like you do by pressing CTRL while selecting cells in excel?
I was thinking by using the UNION-method, but can't get it to work.
Re: Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 11:04 am
by Otto
Hello Marc,
something off topic.
May I ask why you need to use EXCEL?
I am in our company and with my customers for my saying: "EXCEL is the greatest productivity killer in the company." known.
I don't like these self-made EXCEL solutions in companies.
But there are certainly good reasons to use EXCEL.
Best regards,
Otto
Re: Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 11:39 am
by Marc Vanzegbroeck
Otto,
I'm creating a program for a chemical-company that automaticly the info coming from process-engineer and it will import the info directy in the process-database by the Apllication-Engineer. (I'm also working there also as a freelance DCS-Application-Engineer)
The process-engineers give the data in excel. The program reads the excel, and compare the data with the existing database.
The program put some colors, conditional formats and comboboxes on the excel, so the engineers see the differences, and can select the data that can be overwriten.
Then the programs reads the excel, and import the data.
For safety-reasons, the network of the Process-engineers and the process-network may not be connected to each other.
So the transfer of data between the process-engineers and the application-engineers is with excel-files.
Otto wrote:Hello Marc,
something off topic.
May I ask why you need to use EXCEL?
I am in our company and with my customers for my saying: "EXCEL is the greatest productivity killer in the company." known.
I don't like these self-made EXCEL solutions in companies.
But there are certainly good reasons to use EXCEL.
Best regards,
Otto
Re: Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 12:22 pm
by Otto
Marc,
can't you use a Fivewin o mod harbour program for the imput.
Best regards,
Otto
Re: Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 5:12 pm
by driessen
Otto,
I am using Excel quite a lot for reporting.
Why?
My applictions are used by laywers. The courts demands reports in Excel.
That's why I use Excel.
My opinion? Not that difficult at all. I have made quite some dynamic reports.
Re: Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 7:48 pm
by Otto
Michel,
It is not a matter of difficult or not.
But I don't think it's good when office employees use EXCEL for solutions, it takes so much working time and the solutions are semi-professional. EXCEL is simply not suitable.
I keep seeing that a professional solution is much more productive and cheaper.
But that's just my experience. With these many EXCEL tables, you don't bring a standard into operation.
But we're talking about different missions here. You only use it as a reporting tool.
It is OK. But also one of the reasons why we don't get any further with EasyReport.
Best regards,
Otto
Re: Selectecing mutiple cells in excel
Posted: Thu Aug 13, 2020 9:24 pm
by Marc Vanzegbroeck
Otto,
In my case, it's a data exchange between 2 different programs/systems.
The process-engineers are using a program that draw the functions that has to be implement in a process-system. The are using the same program for different vendors, like Honeywell, Siemens, Yokogawa, Emmerson,HIMA,....
That program can export to excel.
Normaly we have to build the functions manual on the process-system. In my case on a Honeywell DCS-system. That system has it's own import-files with it's own structure. It can't read data from another database. So we use excel for info like descriptors, ranges, alarms,... to import in the system...
Re: Selectecing mutiple cells in excel
Posted: Fri Aug 14, 2020 2:24 pm
by MaxP
Hello Marc,
to select multiple cells in one step try to create a string with cell references.
Code: Select all
#include "FiveWin.ch"
FUNCTION MAIN()
LOCAL oExcel, oWorkBooks, oSheet, oRange
TRY
oExcel := TOleAuto():New( "Excel.Application" )
CATCH
oExcel := NIL
END
IF oExcel <> NIL
oWorkBooks := oExcel:WorkBooks
IF oWorkBooks <> NIL
oWorkBooks:Add()
oSheet := oExcel:ActiveSheet
oRange := oSheet:Range( "B2:B2;C3:C3;D4:D4;E5:E5;F6:F6" )
oRange:Value := 1
oExcel:Visible := .T.
ENDIF
ENDIF
RETURN NIL
Best regards,
Massimo
Re: Selectecing mutiple cells in excel
Posted: Fri Aug 14, 2020 3:26 pm
by Marc Vanzegbroeck
Thank you Massimo, it's working fine.