Valnurat Posted May 21, 2016 Author Posted May 21, 2016 Yes, my mistake. I'm sorry. No, the data don't need to be on the computer after the script ends. I only need to use the data to put on a graph and when I press a save button, I will save the data, from the array or some kind, in a text file. And when I think of it, I really don't think it is necessary that the data is sorted as my examples shows. I'm sorry for my own confusion. Yours sincerely Kenneth.
water Posted May 21, 2016 Posted May 21, 2016 Then 2D-arrays seems to be what you are looking for. Loop through the rows until the value is found then simply copy the data to the target cell and set the source cell to "". Maybe the wiki for Arrays answers all your questions. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
rudi Posted May 21, 2016 Posted May 21, 2016 Nice thread! LOL @Valnurat As you were asked before: Please describe your *TASK*. From the very beginning to it's final end! If you don't, it's virtually impossible to give you any valuable advice! Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Valnurat Posted May 21, 2016 Author Posted May 21, 2016 2 hours ago, water said: Then 2D-arrays seems to be what you are looking for. Loop through the rows until the value is found then simply copy the data to the target cell and set the source cell to "". Maybe the wiki for Arrays answers all your questions. You see, that was also my idea, but I'm not interested to set the source to "". I would like to delete so it is empty. I'm not sure how to find the Wiki for array. Could you send me a link? Yours sincerely Kenneth.
water Posted May 21, 2016 Posted May 21, 2016 Define "empty". My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Valnurat Posted May 21, 2016 Author Posted May 21, 2016 If you look in example 1 in my startpost. After move of number 2, number 3 takes number 2 place. So instead of ubound(C0) = 3 it should be Ubound(C0) = 2 Yours sincerely Kenneth.
kcvinu Posted May 22, 2016 Posted May 22, 2016 @Valnurat I think you should consider an ini file for this task. Why i am saying this because, you don't have excel in your pc. In an ini file, you have sections instead of columns. In each section, you have keys instead of rows. So it will be easy to save, search, move data inside an ini file. Just look at IniRead, IniWrite functions. And this what your ini file looks like. Sec_1 key_1=val1 key_2=val2 key_3=val3 Sec_2 key_1=val1 key_2=val2 key_3=val3 And so on.. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
Valnurat Posted May 22, 2016 Author Posted May 22, 2016 But I don't know the content from the start. Yours sincerely Kenneth.
kcvinu Posted May 22, 2016 Posted May 22, 2016 @Valnurat let me know your program's working scenario. From the very beginning , where this data coming from ?. By user input or from any webpage or from any file ? Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
Valnurat Posted May 22, 2016 Author Posted May 22, 2016 We have at my work a small program that analyse some data from out ticket system. That number I need to enter in this application I will make. So I just need to have thesde numbers present for a short while. The only problem right now as I see it, is how can I delete "" cell in a array and move the rest a place up, as I explained, if I should follow Mr. Water solution. Yours sincerely Kenneth.
kcvinu Posted May 22, 2016 Posted May 22, 2016 (edited) As far as i know, you are entering this data into your program. So what make you think like this 6 hours ago, Valnurat said: But I don't know the content from the start. It's ok that water's solution will do the work. Anyway, mine is just another suggestion only. Edited May 22, 2016 by kcvinu Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
Valnurat Posted May 22, 2016 Author Posted May 22, 2016 Oh, so you mean that Sec1 could be Column1? Right now I have found this, but this is only for a 1D array. Yours sincerely Kenneth.
kcvinu Posted May 22, 2016 Posted May 22, 2016 Yes. And why did you trying with arrays ? I am assuming that you need this data after restarting your program. Am i right ? Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
water Posted May 22, 2016 Posted May 22, 2016 22 hours ago, Valnurat said: You see, that was also my idea, but I'm not interested to set the source to "". I would like to delete so it is empty. I'm not sure how to find the Wiki for array. Could you send me a link? Quite simple. Click on "wiki" at the top of this page, enter "arrays" into the search field and click "search" - that's it My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Valnurat Posted May 22, 2016 Author Posted May 22, 2016 2 hours ago, kcvinu said: Yes. And why did you trying with arrays ? I am assuming that you need this data after restarting your program. Am i right ? I already answer that question. On 21-05-2016 at 4:07 PM, Valnurat said: Yes, my mistake. I'm sorry. No, the data don't need to be on the computer after the script ends. I only need to use the data to put on a graph and when I press a save button, I will save the data, from the array or some kind, in a text file. And when I think of it, I really don't think it is necessary that the data is sorted as my examples shows. I'm sorry for my own confusion. Yours sincerely Kenneth.
Valnurat Posted May 22, 2016 Author Posted May 22, 2016 2 hours ago, water said: Quite simple. Click on "wiki" at the top of this page, enter "arrays" into the search field and click "search" - that's it LOL. Yes, true. Thank you. But I don't see any example of how to delete cells in the arrays. Yours sincerely Kenneth.
water Posted May 22, 2016 Posted May 22, 2016 You can't delete a row or column from an array. You have to copy the content of a cell and then you could use ReDim to remove the last row/column of the array. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Valnurat Posted May 22, 2016 Author Posted May 22, 2016 I'm sorry, but I don't want to delete a row or a column. Only the cell where my number is in. Yours sincerely Kenneth.
water Posted May 23, 2016 Posted May 23, 2016 You can't have an array with different UBound values in rows or columns. You can only reduce the UBound on full rows or columns. As you pass the data to another program, which values does this program accept as "empty"? Space, NULL, 0 ...? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Valnurat Posted May 23, 2016 Author Posted May 23, 2016 (edited) So if my C0 have 2 values and my C1 have 4 and I do a UBound(C0) it will be 4? If that true, then I need to run through all the columns in my array and search for cells that's not empty and then I have my "Ubound" so of speak? Edited May 23, 2016 by Valnurat Yours sincerely Kenneth.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now