LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default random cells in a row

This might work better. I re-read your explanation and saw that you want it
on the same sheet.

Sub moveNumbs()
lastRow = Worksheets(1).UsedRange.SpecialCells(xlCellTypeLas tCell).Row + 1
For i = 1 To lastRow
If Cells(i, 1) < "" And IsNumeric(Cells(i, 1)) Then
Cells(i, 1).Copy
If Cells(1, 3) = "" Then
ActiveSheet.Cells(1, 3).PasteSpecial Paste:=xlValues
Else
Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1,
3).PasteSpecial Paste:=xlValues
End If
End If
If Cells(i, 2) < "" And IsNumeric(Cells(i, 2)) Then
Cells(i, 2).Copy
If Cells(1, 4) = "" Then
ActiveSheet.Cells(1, 4).PasteSpecial Paste:=xlValues
Else
Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1,
4).PasteSpecial Paste:=xlValues
End If
End If
Next
Application.CutCopyMode = False
End Sub


" wrote:

There can be as little as 1 in A and 1 in B and as high as 10 in A and
10 in B
If I could get them to the top of C and D in the same sheet I can do
the rest.
The other factor that I require is lets say there is a number in A:137
and A:3000, I want the number in A137 at the very top and I need the
same of B.

Am I making any sence?




 
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 sum up random cells Josh W Excel Worksheet Functions 25 April 2nd 23 07:56 PM
How to select other random cells Chad Excel Worksheet Functions 0 April 23rd 10 02:49 PM
#Value in random cells Michael Excel Worksheet Functions 2 June 19th 09 06:31 PM
random merged cells grant1 Excel Discussion (Misc queries) 0 July 24th 08 05:19 PM
fill random cells hulub Excel Programming 1 September 19th 04 08:26 PM


All times are GMT +1. The time now is 03:06 AM.

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"