+ Reply to Thread
Results 1 to 6 of 6

fill any 6 of 18 cells randomly with an "X"

Hybrid View

  1. #1
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: fill any 6 of 18 cells randomly with an "X"

    Hi, MyComputerGuy,

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.ozgrid.com/forum/showthread.php?t=181208

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,645

    Re: fill any 6 of 18 cells randomly with an "X"

    Sub fill_random_x_v2()
    Dim x As Integer, y As Integer
    Dim rng As Range
    Set rng = Sheets("Sheet1").Range("A1:C6")
       
    rng.ClearContents
       
    Do While Application.WorksheetFunction.CountIf(rng, "x") < 6
        x = Int(1 + Rnd() * rng.Rows.Count)
        y = Int(1 + Rnd() * rng.Columns.Count)
        Cells(x, y) = "x"
    Loop
       
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Auto Fill Blank Cells - Using Differing "Start" Numbers
    By HowD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2013, 01:05 PM
  2. [SOLVED] Manually fill up 1 or (some) cells with just "BFW"or"BF" in data validation
    By robke1960 in forum Non English Excel
    Replies: 2
    Last Post: 12-11-2012, 11:31 AM
  3. VBA. Fill empty cells with text "OPEN", I2 downwards, row count Col A
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2011, 06:50 PM
  4. Replies: 5
    Last Post: 06-12-2008, 12:39 PM
  5. Replies: 3
    Last Post: 01-15-2006, 12:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1