1) is there any way that when i click a cell in a sheet then a msg box pops open.
i want to put it in a function/sub
2) how to pass an array from a function to another function or sub
Please i want it urgently...
1) is there any way that when i click a cell in a sheet then a msg box pops open.
i want to put it in a function/sub
2) how to pass an array from a function to another function or sub
Please i want it urgently...
Right click on the sheet and select View Code. Put this code inExplain what you intend to do in your point 2 above.Please Login or Register to view this content.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
If you want to for example a msgbox to open in Sheet1 when you click cell A1 then in Sheet 1 place the following code
Part 2 - pass an arrayPlease Login or Register to view this content.
Probably need a little more information but as a guide
The doWork sub populates a 2 dimensional array and passes it to the sub test which prints out in the immediate window the values of the array. Same works with function - just pass the array to the function and the function then does something with the array and returns a value - e.g. add up the values in the array. That is the basics but depending on what you want to do just pass the variable to the function or sub.Please Login or Register to view this content.
Remember the purpose of a function is to return a value so many times you may not need a function - depends if you need to return a value.
Hope this helps.
Anthony
Pack my box with five dozen liquor jugs
PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks