LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Dennis
 
Posts: n/a
Default How to Select a relative range with Using "Find" and Offset()

XL 2003

The following works fine:

Sub OneCellText()

Dim MyRange As Range
Dim MyCell As Range
Dim TempVar As String
Set MyRange = Selection

For Each MyCell In MyRange
If MyCell.Value < "" Then TempVar = TempVar + MyCell.Value + Chr(10)
Next MyCell
Range("E41").Formula = TempVar
End Sub

I would like to "compute" MyRange as follows:

Cells.Find(What:="IMPACTED ACCOUNTS").Activate
ActiveCell.Offset(1, 3).Range("A1:E10").Select

Where things get tough is that the W/S that I review have
merged cells in many places. Merged cells seem to screw
up what .Range("A1:E10") selects. (Meaning, if I un-merge the merged cells
then .Range("A1:E10") works perfect. But with merged the selection of
..Range("A1:E10") picks up a different range)

Also, I am not sure how to formulate the ability of the macro to select the
row range to include all rows from
ActiveCell.Offset(1, 3) (above) XLDown to the first cell that is empty. In
addition, the Column range to move XLRight
to the first cell that is empty.

In short, how do I,
1)work around the merged cell vs. Offset()issue? (Note:
I can not change the merged cells (rights issue)

2)enhance the macro to compute the range to insert into
"MyRange" in the first macro?

Thanks, Dennis
 
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
Excel charts should let me select a range for data labels. Relmbo Charts and Charting in Excel 3 June 26th 05 02:33 PM
Find Median of Positive numbers only in Range MichaelC Excel Worksheet Functions 4 June 24th 05 03:06 AM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
How do I find the two lowest values in a range? dlroelike Excel Worksheet Functions 3 February 21st 05 12:12 AM
How do I change an Excel range of cells from relative to absolute. Jrhenk Excel Worksheet Functions 2 November 15th 04 10:55 PM


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