Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How to create a macro to control data flow

I need to create a macro to transfer info from one worksheet to another based
on the input of a certain cell.

Example of what I'm trying to do:

Workbook 1 Sheet 1:

A B C D

1 Name Type ID User

If Sheet 1 B3 = Blue, send data in row 3 to sheet 2, next availiable row,
and also to Sheet 4 next availiable row.

If Sheet 1 B3 = Green, send data in row 3 to sheet 3, next availiable row
and also Sheet 4 next availiable row.

And I am also creating sheet 5 to do some scheduling and tracking which I
can adjust the process as needed.

I'd appreciate any help.

Thanks,




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 751
Default How to create a macro to control data flow

Sub copy2sheets()
Dim i As Long, j as long, s2row As Long, s3row As Long, s4row As Long
i = 2
s2row = 2
s3row = 2
s4row = 3
While Sheets("Sheet1").Cells(i, 1) < ""
If Sheets("Sheet1").Cells(i, 2) = "Blue" Then
For j = 1 To 4
Sheets("Sheet2").Cells(s2row, j).Value =
Sheets("Sheet1").Cells(i, j).Value
Sheets("Sheet4").Cells(s4row, j).Value =
Sheets("Sheet1").Cells(i, j).Value
Next j
s2row = s2row + 1
s4row = s4row + 1
ElseIf Sheets("Sheet1").Cells(i, 2) = "Green" Then
For j = 1 To 4
Sheets("Sheet3").Cells(s3row, j).Value =
Sheets("Sheet1").Cells(i, j).Value
Sheets("Sheet4").Cells(s4row, j).Value =
Sheets("Sheet1").Cells(i, j).Value
Next j
s3row = s3row + 1
s4row = s4row + 1
End If
i = i + 1
Wend
End Sub

HTH
Kostis Vezerides

On Mar 28, 4:04*pm, JW_4222 wrote:
I need to create a macro to transfer info from one worksheet to another based
on the input of a certain cell.

Example of what I'm trying to do:

Workbook 1 Sheet 1: *

* * *A * * * * * B * * * * * C * * * * *D

1 * Name * * Type * * ID * * * * User

If * Sheet 1 B3 = Blue, send data in row 3 to sheet 2, next availiable row,
and also to Sheet 4 next availiable row.

If *Sheet 1 B3 = Green, send data in row 3 to sheet 3, next availiable row
and also Sheet 4 next availiable row.

And I am also creating sheet 5 to do some scheduling and tracking which I
can adjust the process as needed.

I'd appreciate any help.

Thanks,


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 do I use excel to create process flow diagrams? BD1 Excel Discussion (Misc queries) 4 October 19th 07 11:10 PM
How do I label flow connectors in and excel flow chart? Hannah Excel Discussion (Misc queries) 1 September 7th 06 07:55 PM
can you create a cash flow diagram in excel jk Charts and Charting in Excel 0 May 12th 06 03:53 PM
How do I create a slider bar in Excel to control data input? P-15 Charts and Charting in Excel 1 April 5th 06 12:34 PM
How do i create an automatic monthly cash flow from lists of cost. Fadi Excel Discussion (Misc queries) 0 February 25th 05 02:47 PM


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