Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops - Minor typo
for the moment, you get Cells(3, 2) which is the same as Cells(Row 3, Column 2) which is the cell B2. should be B3. Apologies. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Ken Wright" wrote in message ... Password = Password & Worksheets("sheet1").Cells(3 + i, 2 + j) Note the Worksheets("sheet1").Cells(3 + i, 2 + j) bit. The cells(x, y) section of that statement is a way of referencing a cell. If you ignore the i and j bit for the moment, you get Cells(3, 2) which is the same as Cells(Row 3, Column 2) which is the cell B2. Now, here is where the i and j come into play. Based on the code, i and j will always be equal to somewhere between 1 and 10 inclusive, so the Cells(Row, Column) bit will always give you Cells(Row 3 + {1 to 10}, Column 2 + {1 to 10}), so the very minimum you will get is Cells(Row 3 + 1, Column 2 + 1), which equals Cells(4, 3), which equals C4 and the max Cells(Row 3 + 10, Column 2 + 10), which equals Cells(13, 12), which equals L14 so your range of C4:L14 is encompassed within those parameters The Worksheets("sheet1"). before the Cells(... bit, simply says that the range being referred to is on Sheet1. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Martyn" wrote in message ... Thanks Marcotte A, Now it functions all right. But I wonder, which code section refers to the C4:L13 area cells? TIA "Marcotte A" wrote in message ... "Martyn" wrote: Hi Marcotte A, I am only able to generate a dot as a password(!) using this code. Am I doing something wrong?. Martyn Do you have source words in the range C4:L13? The code is designed to pick 2 random cells from a 10x10 range filled with 4 letter strings and combine them. I'm guessing that those cells are blank so the Password variable never changes from "", so when the MsgBox displays you just get what is in the double quotes (including the final dot). --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.708 / Virus Database: 464 - Release Date: 18/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.708 / Virus Database: 464 - Release Date: 18/06/2004 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Non-random numbers generated by excel's data analysis random gener | Excel Worksheet Functions | |||
Non-random numbers generated by excel's data analysis random gener | Excel Discussion (Misc queries) | |||
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. | Excel Worksheet Functions | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) | |||
Excel password but cant hide the sheets before entering password | Excel Programming |