Imran Azam
Board Regular
- Joined
- Mar 15, 2011
- Messages
- 103
Hi guys
I am trying to create a macro to select and replace data on an array and display this onto a spreadsheet i am struggling to create this.
the code needs to reads the group of data below ( range cell A1- to cell f-10), into an array , and then allow the user to type a number via an inbox, this number represents the number they would like to replace from the arrey created ( range of data shown below) and, then allow user to type another number via another inbox, this number is to replace the other number in the array and displays this on the spreadsheet.
Only a number should be entered into the input box, if something other than a number is entered the inbox should reappear again.
If a number is typed in the first inbox ( the one that select number which user wants to replace) and this number isnt in array created then a message box with a warning icon ( yellow triangle with ! mark), a title “Alert” and a message saying “number not found” should appear
example data below
So the steps needed are blow
1) all the number in the group need to read into a new Array
2) Show an input box with a message ‘please entre number you wish to replace’ this should only accept numbers, if anything other than a number is typed the same input box should reappear ( when ok is clicked )until a number is typed
3) when the last step is taken by the user another inbox need to appear with message ‘please enter a new number you wish to replace selected number with’ again only number need to be entered in this input box if not number then same as step 2 will happen( input box reappear until number is entered)
4) when the last step is done by the user and the ok button is pressed the selected number is replace with the new number in the Arrey created in step 1 and also show this change on the in the group of numbers in the spreadsheet
5) If a number typed in the first inbox ( the one that select number which user wants to replace) isnt in the array entries ( array created in step 1) then a message box with a warning icon ( yellow triangle with ! mark), a title “Alert” and a message saying “number not found” should appear
hope i am making sense if not please just message
can anyone help with this?
i have also posted image of the data
I am trying to create a macro to select and replace data on an array and display this onto a spreadsheet i am struggling to create this.
the code needs to reads the group of data below ( range cell A1- to cell f-10), into an array , and then allow the user to type a number via an inbox, this number represents the number they would like to replace from the arrey created ( range of data shown below) and, then allow user to type another number via another inbox, this number is to replace the other number in the array and displays this on the spreadsheet.
Only a number should be entered into the input box, if something other than a number is entered the inbox should reappear again.
If a number is typed in the first inbox ( the one that select number which user wants to replace) and this number isnt in array created then a message box with a warning icon ( yellow triangle with ! mark), a title “Alert” and a message saying “number not found” should appear
example data below
1 | 4 | 7 | 10 | 13 | 16 |
3 | 6 | 9 | 12 | 15 | 18 |
5 | 8 | 11 | 14 | 17 | 20 |
1 | 10 | 13 | 16 | 19 | 22 |
3 | 12 | 15 | 18 | 21 | 24 |
5 | 14 | 17 | 20 | 23 | 26 |
1 | 16 | 19 | 22 | 25 | 28 |
3 | 10 | 2 | 24 | 27 | 30 |
2 | 10 | 4 | 2 | 29 | 32 |
4 | 12 | 6 | 4 | 31 | 34 |
So the steps needed are blow
1) all the number in the group need to read into a new Array
2) Show an input box with a message ‘please entre number you wish to replace’ this should only accept numbers, if anything other than a number is typed the same input box should reappear ( when ok is clicked )until a number is typed
3) when the last step is taken by the user another inbox need to appear with message ‘please enter a new number you wish to replace selected number with’ again only number need to be entered in this input box if not number then same as step 2 will happen( input box reappear until number is entered)
4) when the last step is done by the user and the ok button is pressed the selected number is replace with the new number in the Arrey created in step 1 and also show this change on the in the group of numbers in the spreadsheet
5) If a number typed in the first inbox ( the one that select number which user wants to replace) isnt in the array entries ( array created in step 1) then a message box with a warning icon ( yellow triangle with ! mark), a title “Alert” and a message saying “number not found” should appear
hope i am making sense if not please just message
can anyone help with this?
i have also posted image of the data