Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default how to delete different data from different cell at a time and lea

some data in da same cell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I delete data in a cell without deleting formula? tripy Excel Worksheet Functions 9 January 1st 21 10:27 AM
Specify a row based on data from a cell to delete entire row..... Fadedmartinikiss Excel Discussion (Misc queries) 0 March 11th 09 08:39 PM
Delete duplicate data in a single cell kacey28 Excel Worksheet Functions 10 June 24th 08 04:59 PM
delete hyphens within a cell while maintaining the data therein fancode Excel Discussion (Misc queries) 1 November 4th 07 10:44 PM
Delete cell data in a row Nick Smith[_2_] Excel Programming 2 April 20th 06 02:17 PM


All times are GMT +1. The time now is 02:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"