Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This one is right on the money. Thank you!
-A "Rick Rothstein" wrote: Sorry, I misread your question. Give this macro a try instead... Sub FindGrandTotal() Dim GrandTotal As Range, DataSheet As Worksheet, CopySheet As Worksheet Set DataSheet = Worksheets("Sheet3") Set CopySheet = Worksheets("X") Set GrandTotal = DataSheet.Columns("B").Find("Grand Total", _ LookAt:=xlWhole, MatchCase:=False) If Not GrandTotal Is Nothing Then CopySheet.Range("I9").Resize(Columns.Count - 31) = WorksheetFunction. _ Transpose(Range(GrandTotal.Offset(0, 30), DataSheet.Cells( _ GrandTotal.Row, Columns.Count))) End If End Sub -- Rick (MVP - Excel) "Rick Rothstein" wrote in message ... Does this macro do what you want? Sub FindGrandTotal() Dim StartDataColumn As Long, LastDataColumn As Long StartDataColumn = 31 LastDataColumn = Cells.Find(What:="*", SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Column Columns("B").Find("Grand Total", LookAt:=xlWhole, MatchCase:=False). _ Offset(0, StartDataColumn - 1).Resize(1, _ LastDataColumn - StartDataColumn).Select End Sub -- Rick (MVP - Excel) "AlexJarvis" wrote in message ... I am trying to write a macro that will let me find a specific vale in a specific column, then select part of the row that the value is in, beginnign with a column 31 cells away from the column that the specific value is in. Someone suggested to me that I use an IF statement, but this is all I know about that: IF [value in column B] is €śGrand Total€ť Then select from column AF to the end of the array in that row and copy it and paste a transpose of the values starting in cell I9 of worksheet X. What is the best way for me to accomplish this goal? . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
find & select | Excel Worksheet Functions | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
select date range then find average of values in another cell | Excel Worksheet Functions | |||
How to Select a relative range with Using "Find" and Offset() | Excel Discussion (Misc queries) |