Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem coding a Sort
How do I code this so as to use an Integer containing 7 for the column?
dataRange.Sort Key1:=Range("G5") (Set dataRange = ActiveWorkbook.Sheets("source"). _ ( Range(Cells(iStartDataRow, 1), _ ( Cells(iMaxRowNumb, iMaxColNumb)) Thanks, Peter. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem coding a Sort
icol = 7
dataRange.Sort Key1:=worksheets("Source").Cells(5,icol) -- Regards, Tom Ogilvy "Peter Chatterton" wrote in message . .. How do I code this so as to use an Integer containing 7 for the column? dataRange.Sort Key1:=Range("G5") (Set dataRange = ActiveWorkbook.Sheets("source"). _ ( Range(Cells(iStartDataRow, 1), _ ( Cells(iMaxRowNumb, iMaxColNumb)) Thanks, Peter. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem coding a Sort
Hi Tom,
Dim iCol As Integer iCol = 7 dataRange.Sort Key1:=ActiveWorkbook.Sheets("source").Cells(5, iCol) When I try it I get "Appl-def'd or Obj-def'd error". BTW what is the 5 for? Thanks, Peter. "Tom Ogilvy" wrote in message ... icol = 7 dataRange.Sort Key1:=worksheets("Source").Cells(5,icol) -- Regards, Tom Ogilvy "Peter Chatterton" wrote in message . .. How do I code this so as to use an Integer containing 7 for the column? dataRange.Sort Key1:=Range("G5") (Set dataRange = ActiveWorkbook.Sheets("source"). _ ( Range(Cells(iStartDataRow, 1), _ ( Cells(iMaxRowNumb, iMaxColNumb)) Thanks, Peter. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem coding a Sort
UPDATE TO MY REPLY
(couldn't reply to myself) I took the As Integer off my defn of iCol and it worked! But haven't figured it out yet. Thanks, Peter. "Tom Ogilvy" wrote in message ... icol = 7 dataRange.Sort Key1:=worksheets("Source").Cells(5,icol) -- Regards, Tom Ogilvy "Peter Chatterton" wrote in message . .. How do I code this so as to use an Integer containing 7 for the column? dataRange.Sort Key1:=Range("G5") (Set dataRange = ActiveWorkbook.Sheets("source"). _ ( Range(Cells(iStartDataRow, 1), _ ( Cells(iMaxRowNumb, iMaxColNumb)) Thanks, Peter. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel VBA coding problem | Excel Discussion (Misc queries) | |||
Help with my coding problem? | Excel Worksheet Functions | |||
First attempt at VBA coding problem | New Users to Excel | |||
Excel VBA : Coding Problem | Excel Programming | |||
Excel Coding Problem | Excel Programming |