ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   please help in this program_1 (https://www.excelbanter.com/excel-discussion-misc-queries/133267-please-help-program_1-a.html)

TheGodfather

please help in this program_1
 
Problem 2 - Delete
Excel Background
In a new sheet go to A1 and enter the value 1. In A2 enter the
following formula:
=IF(RAND()<0.2,A1,A1+1)
Copy the formula down until A30. The result will be groups of
increasing numbers. Select the entire column, Copy, Paste Special...
Values only, to stabilize the data. Now you will have mostly
successive numbers and at times a number will appear twice.
Class Libraries
Repeat what you did with Insert, but now with Delete. Be careful, it
is different to clear a cell's contents by pressing the Delete key in
the keyboard; it is different to delete a cell using the menu command.
VBA Task
Write a VBA macro to go down the list in column A:A. The algorithm
should delete numbers that are not successive. E.g. if you have
numbers 1, 2, 3, 3, 4, 5, 5, 6, the second 3 and the second 5 should
be deleted to reach a perfectly sequential list 1, 2, 3, 4, 5, 6.



All times are GMT +1. The time now is 03:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com