can tthis countdown be done

Acehole

Board Regular
Joined
Sep 29, 2009
Messages
249
hello,
trying to count down from a number in a cell, C3 for exmaple, this will contain a random number.
i want excel to see this number then populate the rest of the cells c4 c5 c6 etc with the number decreasing.
so c3 will be 25 c4 will be 24 c5 will be 23 until it gets to 1
can this be done ?

regards

acehole
 

MickG

MrExcel MVP
Joined
Jan 9, 2008
Messages
14,841
One way:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG20Mar52
[COLOR="Navy"]Dim[/COLOR] Tem [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]With[/COLOR] Range("C3")
    Tem = .value
    .value = 1
    .AutoFill Destination:=Range("C3").Resize(Tem), Type:=xlFillSeries
    .Resize(Tem).Sort Range("C3"), xlDescending
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 

Acehole

Board Regular
Joined
Sep 29, 2009
Messages
249
Wow,
that works a treat as I suspected the forum would come up with the goods,
final question if possible
i have the numbers now counting down in cell c3 onwards
the cells a3 and b3 have information I would like to copy down to the last number in cell c
so it would look like this
a3. B3. C3


1234. 5. 25
1233. 5. 24
1234. 5. 23


cells a and b will not increase or decrease in value just need to copy down


thanks for the help
Acehole
 

MickG

MrExcel MVP
Joined
Jan 9, 2008
Messages
14,841
If you're referring to my code then try this:-

Code:
[COLOR="Navy"]Sub[/COLOR] MG20Mar43
[COLOR="Navy"]Dim[/COLOR] Tem [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]With[/COLOR] Range("C3")
    Tem = .value
    .value = 1
    .AutoFill Destination:=Range("C3").Resize(Tem), Type:=xlFillSeries
    .Resize(Tem).Sort Range("C3"), xlDescending
    Range("A3:B3").Resize(Tem).value = .Offset(, -2).Resize(, 2).value
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 

Acehole

Board Regular
Joined
Sep 29, 2009
Messages
249
Hi mick thank you for the replies
i am trying your formula now but can't get it to work, being a novice I guess I am putting the code in the wrong place?
any suggestions
thanks
acehole
 

Acehole

Board Regular
Joined
Sep 29, 2009
Messages
249
hi Mick,
when your code runs i get this error message come up on this line

.AutoFill Destination:=Range("C3").Resize(Tem), Type:=xlFillSeries

looks like it fills the numbers down but not the columns a and b and their infomation

regards
acehole
 

Forum statistics

Threads
1,078,504
Messages
5,340,763
Members
399,394
Latest member
farlow

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top