Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Dependent On Cell Value


I have data on Sheet1 Range A5:E25, A contains text B:E contains
values.

I want to copy the data from Sheet1 to Sheet 2 dependent on the text in
Sheet 1 Column A.

Example:

If A5 on Sheet 1 is < than "Other Publisher Groups" I want to copy
A5:E5 to Sheet 2 cell B4:F4.

If A5 on Sheet 1 is ="Other Publisher Groups" I want to drop down a row
and copy A6:E6 to Sheet 2 cell B4:F4.

In short If the value in A is < to "Other Publisher Groups" I want to
copy

Sheet1 A5:E5 to Sheet 2 B4:F4 Then
Sheet1 A6:E6 to Sheet 2 B5:F5
Sheet1 A7:E7 to Sheet 2 B6:F6

If Sheet1 A8 = "Other Publisher Groups" I would jump a row i.e.

Sheet1 A9:E9 to Sheet 2 B7:F7

Hope that makes sense.


--
Timbo
------------------------------------------------------------------------
Timbo's Profile: http://www.thecodecage.com/forumz/member.php?userid=24
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=98084

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy Dependent On Cell Value

I think you just want to copy rows that don't havve "Other Publisher Groups"

Sub movedata()

DestRow = 4
With Sheets("Sheet1")
RowCount = 4
Do While .Range("A" & RowCount) < ""
If .Range("A" & RowCount) < "Other Publisher Groups" Then
.Range("A" & RowCount & ":E" & RowCount).Copy _
Destination:=Sheets("Sheet2").Range("B" & DestRow)
DestRow = DestRow + 1
End If
RowCount = RowCount + 1
Loop

End With

End Sub

"Timbo" wrote:


I have data on Sheet1 Range A5:E25, A contains text B:E contains
values.

I want to copy the data from Sheet1 to Sheet 2 dependent on the text in
Sheet 1 Column A.

Example:

If A5 on Sheet 1 is < than "Other Publisher Groups" I want to copy
A5:E5 to Sheet 2 cell B4:F4.

If A5 on Sheet 1 is ="Other Publisher Groups" I want to drop down a row
and copy A6:E6 to Sheet 2 cell B4:F4.

In short If the value in A is < to "Other Publisher Groups" I want to
copy

Sheet1 A5:E5 to Sheet 2 B4:F4 Then
Sheet1 A6:E6 to Sheet 2 B5:F5
Sheet1 A7:E7 to Sheet 2 B6:F6

If Sheet1 A8 = "Other Publisher Groups" I would jump a row i.e.

Sheet1 A9:E9 to Sheet 2 B7:F7

Hope that makes sense.


--
Timbo
------------------------------------------------------------------------
Timbo's Profile: http://www.thecodecage.com/forumz/member.php?userid=24
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=98084


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 blank data validation cell after changing dependent cell? Ian Elliott Excel Discussion (Misc queries) 5 August 16th 09 02:42 AM
Copy from one named cell to another dependent on content of a third. Colin Hayes Excel Worksheet Functions 3 February 5th 08 03:56 PM
Jumping reference cell in dependent cell formula jpeterspro Excel Worksheet Functions 1 November 28th 07 10:34 AM
Another cell formatting dependent on cell contents question / message box popup? StargateFan[_3_] Excel Programming 2 January 14th 06 02:47 PM
Change Cell Color dependent on Cell Contents Bill Excel Programming 4 March 15th 05 04:33 PM


All times are GMT +1. The time now is 09:03 AM.

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"