Thread: group by report
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
flummi
 
Posts: n/a
Default group by report

Hi Trav,

Here's the answers:


'this is for taking a value from a user specified cell and put it
somewhere else

' r = Range("e1").Value '<-- this is where your user has entered
the cell reference
Cells(1, 1).Value = Range(r).Value 'cell(r,c) indicates where to
put the value

'This lets a user specify a column to sort

r = Range("e1").Value '<-- this is where your user has entered
the column letter
Range("A1:A7").Sort _
Key1:=Columns(r)

'This lets a user specify a cell to use that column as sort key

r = Range("e1").Value '<-- this is where your user has entered
the column letter
Range("A1:A7").Sort _
Key1:=Range(r)

'This lets a user specify a range to sum up

sr = Range("e1").Value
er = Range("f1").Value
Set r = Range(sr + ":" + er)
tot = 0
With r
For Each c In r
tot = tot + c.Value
Next c
Range("C6").Value = tot
End With

'This sets "bold" for all cells in the range (1,1) to (10,4)

Range(Cells(1, 1), Cells(10, 4)).Font.Bold = True

Hans