+ Reply to Thread
Results 1 to 2 of 2

how to delete different data from different cell at a time and lea

  1. #1
    maddy
    Guest

    how to delete different data from different cell at a time and lea

    some data in da same cell

  2. #2
    Tom Ogilvy
    Guest

    RE: how to delete different data from different cell at a time and lea

    Test this on a copy of your workbook

    Select a single rectangular area of cells containing data, then run this macro

    Sub DeleteandLeave()
    '
    ' Randomly deletes some data in different cells at the
    ' time of running while leaving other data in da same cell
    ' Note: unconstrained by the value in the cell
    '
    Set rng = Selection
    For k = 1 To Int(Rnd() * rng.Rows.Count * rng.Columns.Count + 1)
    i = Int(Rnd() * rng.Rows.Count + 1)
    j = Int(Rnd() * rng.Columns.Count + 1)
    rng.Cells(i, j).ClearContents
    Next k
    End Sub


    This may not be exactly what you want, but hopefully it "shows the way".

    --
    Regards,
    Tom Ogilvy


    "maddy" wrote:

    > some data in da same cell


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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