LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Reduce Numbers Down To A Specific Value

On Nov 24, 7:45*am, Paul Black wrote:
Good afternoon,

I have a sheet named “Deletion”, where the results from the Macro are
produced.
I have a sheet named “Results”, where all the data to be used is
stored.
In the sheet named “Deletion” and in cell “D3” I have a value, this
could be anything from 1 to 50.
In the sheet named “Deletion” and in cell “D4” I have a value, this
could also be anything from 1 to 50.
In the sheet named “Results” the data to be used is in cells
“E15:???”.

Now I would like to produce two sets of numbers from this data.
(1) Start with the number in the sheet named “Deletion” and in cell
“D4”, this could be the number 30 for example, so we have numbers 1 to
30 in memory, now I want to start at the bottom right hand corner of
the data in the sheet named “Results” and take that number out of the
numbers 1 to 30, then move to the next cell on the left and take that
number out of the list and then the next number on the left and so on
moving left and then up to the next row and to the right and working
left and up until I have the total numbers left that is the value I
have in the sheet named “Deletion” and in cell “D3”. If the value in
the sheet named “Deletion” and in cell “D3” was 8, then I will be left
with 8 numbers from 1 to 30. I would like these numbers to be output
in sheet named “Deletion” and starting in cell “B7” and continuing
down.
The data for this is in the sheet named “Results” and in cells
“E15:J??”.

(2) Exactly the same as above but I would like these numbers to be
output in sheet named “Deletion” and starting in cell “C7” and
continuing down.
The data for this is in the sheet named “Results” and in cells
“E15:K??”.
The code below does some of what I would like. I hope it gives a good
idea of what I am trying to do.

Sub Find_Specific()
Dim rng As Range
Dim Number As Long

With Worksheets("Deletion")
* Number = .Range("D3").Value
* Set rng = .Range("B2:B43") ' Don't want this in the new Macro
End With

With Worksheets("Results")
* Set rng1 = .Range(.Range("J15"), .Cells(Rows.Count, 5).End(xlUp))
End With

i = rng1.Count
Do While Application.CountA(rng) Number
* *Set cell = rng1(i)
* *rng(rng1(i).Value).ClearContents ' Don't want this in the new Macro
* *i = i - 1
Loop

With Worksheets("Deletion")
* .Range("B2:B50").Copy Destination:=.Range("D2:D50") ' Don't want
this in the new Macro
* .Range("D2:D50").SpecialCells(xlBlanks).Delete Shift:=xlShiftUp '
Don't want this in the new Macro
End With

End Sub

Thanks very much in advance.

Kind regards,
Paul


Hard to tell from this what you want.

Send your file with a complete explanation and before/after examples
to dguillett1 @gmail.com
 
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
Selecting specific numbers from a cell containing multiple numbers JRD Excel Worksheet Functions 3 January 18th 09 12:32 AM
How to reduce all numbers in spreadsheet by a percentage stubarlow New Users to Excel 1 July 5th 07 05:34 PM
excel function reduce and increase numbers Joseph Weber Excel Worksheet Functions 1 December 28th 05 09:12 PM
Can you round numbers to display a specific set of numbers, for e. lbfries Excel Discussion (Misc queries) 3 April 20th 05 09:52 PM
Highlight a row if a specific cell is specific numbers/words sea0221 Excel Worksheet Functions 2 March 9th 05 12:06 AM


All times are GMT +1. The time now is 07:27 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"