Hello,
i have the following problem:
write a program in Visual Basic which inputs an integer n, and produces the following pattern in Excel.In this example, n equals 15, and it has to be an odd number.
\1
can anyone help me? Tnx
Hello,
i have the following problem:
write a program in Visual Basic which inputs an integer n, and produces the following pattern in Excel.In this example, n equals 15, and it has to be an odd number.
\1
can anyone help me? Tnx
Last edited by Hard; 12-14-2011 at 04:22 AM.
Hi
You will need to change your thread title before we can help you. It should contain a description of the problem. Sorry, I know it sounds a bit petty, but these are the forum rules and it will allow others to search and benefit from this thread. Please Go to Edit Post, Go Advanced.
The good news is that I think this is fairly easy and we can quickly solve it once the thread title is fixed.
Cheers, Rob.
Last edited by rscsmith; 12-13-2011 at 06:28 PM.
Hi,
Sounds like an exam question so rather than give you the answer I'll suggest a method.
1. Set up two variables, one a loop counter (say x) and the other an inputbox 'n' variable - in your example 15.
2. Create a For Next loop using the loop counter variable which loops from 1 to n
3. Within the loop add four lines of code. The first two lines to colour the row x & column x cell black and the row x and n-x+1 cells black, the second two lines to colour the row x + n, column x cell black and the row x + n and column n-x+1 cell black.
Regards
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Done. Sorry about that!
Hi,
This was the method I had in mind
RegardsPlease Login or Register to view this content.
Hi
Thanks for updating the title - was itching to respond!
Here's my version of the code:
Cheers, Rob.Please Login or Register to view this content.
Hi,
Thanks all of you for helping me!
Regards
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks