Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mb mb is offline
external usenet poster
 
Posts: 2
Default Range Select

Good morning,

I have a report which lists five different customer's data - each ending
with the phrase "Weekly Turns". Customer data is preceeded by the actual
customer name.

I am trying to find a method to select from the Customer name to the Weekly
Turn row, copy all of the data and paste into a new worksheet. The macro I
used is focused on the specific row number - which will not work, as the
amount of data changes on a regular basis.

Thanks,
MB


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Range Select

Afternoon,

Here's a simple macro.

Few assumptions.

The names are in column A
The first name is in Row 1
There are blank rows between the final row and the next name

I have renamed the sheets with the customer's name

Sub ConvertCustomers()
Dim iLastRow As Long
Dim iStart As Long
Dim iEnd As Long
Dim oWS As Worksheet

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
iStart = 1
iEnd = 1

With ActiveSheet
For iStart = 1 To iLastRow
iEnd = iStart
Do
iEnd = iEnd + 1
Loop Until Cells(iEnd, "A").Value = "Weekly Turns" Or iEnd
iLastRow
Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name =
..Cells(iStart, "A").Value
.Range(.Cells(iStart, "A"), .Cells(iEnd, "A")).EntireRow.Copy _
Destination:=Worksheets(.Cells(iStart,
"A").Value).Range("A1")
iStart = iEnd + 1
.Activate
Next iStart
End With

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"mb" wrote in message
...
Good morning,

I have a report which lists five different customer's data - each ending
with the phrase "Weekly Turns". Customer data is preceeded by the actual
customer name.

I am trying to find a method to select from the Customer name to the

Weekly
Turn row, copy all of the data and paste into a new worksheet. The macro

I
used is focused on the specific row number - which will not work, as the
amount of data changes on a regular basis.

Thanks,
MB




Reply
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
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
I can't select a range in VBA bigjim Excel Discussion (Misc queries) 4 April 12th 08 12:43 AM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Select Range as far as..... universal[_24_] Excel Programming 4 January 15th 04 03:51 PM
Select a range Eva Shanley[_2_] Excel Programming 4 October 20th 03 10:26 PM


All times are GMT +1. The time now is 06:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"