Macro Codes... I have no idea what I'm doing.

helpme05

New Member
Joined
Apr 15, 2013
Messages
1
I am working on a workbook, and I know I need a code. I have never used one and I am clueless. I'm hoping someone can help me!!! I know you have helped others. I want to take the information from one workbook and split it into 2 others depending on one column's information. The "master list" has A1-U466, and grows daily. I need all the information in each row to copy over to another workbook based off the information in column C. The information in column C is either "SA" or "CDF". These will have their own Sheets, labeled as such. I'm working with Excel 2010. Please help me, I am at a loss on how to get this done. Thank you in advance!!!!!!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try this, copy and paste into the "master list" vb editor. Assign to a button or alt+ F8 and select Sub SA_CDF() then click Run.

Code:
Option Explicit

Sub SA_CDF()
Dim i As Range
For Each i In Range("C1:C20")
  If i.Value = "SA" Then i.Offset(0, -2).Resize(1, 21).Copy _
    Destination:=Sheets("SA").Range("A" & Rows.Count).End(xlUp).Offset(1)
  If i.Value = "CDF" Then i.Offset(0, -2).Resize(1, 21).Copy _
    Destination:=Sheets("CDF").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next
End Sub

Regards,
Howard
 
Upvote 0
Whoops, better change this line

For Each i In Range("C1:C20")

to

For Each i In Range("C1:C466")

Howard
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top