#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default looking for a macro

I am looking for a macro that will help me with my problem.... Im having
problems with asking this question correctly so please bare with
me. In my workbook I have a worksheet titled CMG SA Master and six other
sheets test1, test2, test3 etc now on worksheet CMG SA Master I
have columns 1 to 300 (this may grow) and rows A:P (this will not grow).
What I need is a Macro that will look at A2 and if it has an x in it past
the information in A2:P2 into worksheet test1 if not look at B2 if it has
an x then do the same on worksheet test2 if not continue on 4 more time
(C2 test3, D2 test4 etc) now it can have an x in A2 and B2 I would need it
to show up on both sheets test 1 and Test2. Then go down to the next row
and do the same. See example
A B C D E F G H
1
2 x x Processing Joy
3 x x x access Pro


Header row has already been set up on all the sheets row 1.. Thanks in
advance.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default looking for a macro

Sub test()
Dim i As Integer
Dim SheetArray(6) As String
Dim SheetRowNo(6) As Integer

For i = 1 To 6
SheetArray(i) = "Test" & i
SheetRowNo(i) = 1
Next i


Dim CurrCol(6) As String
CurrCol(1) = "A"
CurrCol(1) = "B"
CurrCol(1) = "C"
CurrCol(1) = "D"
CurrCol(1) = "E"
CurrCol(1) = "F"

Dim j As Integer
j = 1

i = 2
For i = 1 To 11
For j = 1 To 6
ActiveWorkbook.Sheets("CMG SA Master").Activate
If Cells(i, j) = "X" Then
Cells(i, 1).EntireRow.Copy
Sheets(SheetArray(j)).Activate
Cells(SheetRowNo(j), 1).Select
ActiveSheet.Paste
SheetRowNo(j) = SheetRowNo(j) + 1
End If
Next j
Next i

End Sub
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default looking for a macro

Change 11 in
For i = 1 To 11
to the number of rows you have...
or you can use
Range("A65536").End(xlUp).Row

"Sheeloo" wrote:

Sub test()
Dim i As Integer
Dim SheetArray(6) As String
Dim SheetRowNo(6) As Integer

For i = 1 To 6
SheetArray(i) = "Test" & i
SheetRowNo(i) = 1
Next i


Dim CurrCol(6) As String
CurrCol(1) = "A"
CurrCol(1) = "B"
CurrCol(1) = "C"
CurrCol(1) = "D"
CurrCol(1) = "E"
CurrCol(1) = "F"

Dim j As Integer
j = 1

i = 2
For i = 1 To 11
For j = 1 To 6
ActiveWorkbook.Sheets("CMG SA Master").Activate
If Cells(i, j) = "X" Then
Cells(i, 1).EntireRow.Copy
Sheets(SheetArray(j)).Activate
Cells(SheetRowNo(j), 1).Select
ActiveSheet.Paste
SheetRowNo(j) = SheetRowNo(j) + 1
End If
Next j
Next i

End Sub

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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM


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