Hello everybody.
I am wet behind the ears with VBA/macro's in excel.
I have a spreadsheet that I use to input information, but I want to copy specific rows from that "active" sheet to other sheets based on the values in the cells of colume"b".
The rows will be copied to different sheets based on the value. At this time I get the information to be copied, but it copies the information to all sheets.
Also, I have only been able to get the macro to look at only 1 cell, and not to all the cells in the column.
I know it is long, cause for every sheet I repeat the same basic formula.
Thanks for any help.
Here is my macro so far:
I am wet behind the ears with VBA/macro's in excel.
I have a spreadsheet that I use to input information, but I want to copy specific rows from that "active" sheet to other sheets based on the values in the cells of colume"b".
The rows will be copied to different sheets based on the value. At this time I get the information to be copied, but it copies the information to all sheets.
Also, I have only been able to get the macro to look at only 1 cell, and not to all the cells in the column.
I know it is long, cause for every sheet I repeat the same basic formula.
Thanks for any help.
Here is my macro so far:
Code:
[COLOR=#0000ff]Sub[/COLOR] Trail_copy()
[COLOR=#008000]'[/COLOR]
[COLOR=#008000]' Macro4 Macro[/COLOR]
[COLOR=#008000]'R1=("B5:B1000")[/COLOR]
[COLOR=#008000]
[/COLOR]
[COLOR=#008000]'If Range("R1").Value("76.0.0") Then[/COLOR]
Sheets("76.0.0").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.0.0").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.0.1) THEN[/COLOR]
Sheets("76.0.1").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.0.1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.0.2) THEN[/COLOR]
Sheets("76.0.2").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.0.2").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.0.3) THEN[/COLOR]
Sheets("76.0.3").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.0.3").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.0.4) THEN[/COLOR]
Sheets("76.0.4").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.0.4").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.0.5) THEN[/COLOR]
Sheets("76.0.5").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.0.5").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.2.1) THEN[/COLOR]
Sheets("76.2.1").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.2.1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.2.2) THEN[/COLOR]
Sheets("76.2.2").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.2.2").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#008000]'IF Range("B3:B500").Value (76.6) THEN[/COLOR]
Sheets("76.6").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Punch list").Select
Range("A9:L9").Select
Selection.Copy
Sheets("76.6").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
[COLOR=#0000ff]End Sub[/COLOR]