Sub AAAA()'
' AAAA Macro
'
'
Sheets("Master Supra").Activate
Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[71]=""Child"",VLOOKUP(RC[-1],'Data Creation'!R1:R1048576,1,FALSE),"""")"
Range("B2").Select
lastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("B2").AutoFill Destination:=Range("B2:B" & lastRow)
Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.Run "DELETENA"
End Sub
Sub DELETENA()
'For Move Entire Row to New Worksheet if Cell Contains Specific Text?
'Using autofilter to Copy rows that contain centain text to a sheet called Errors
Dim LR As Long
LR = Sheets("Master Supra").Cells(Rows.Count, "B").End(xlUp).Row
LR1 = Sheets("Supra Disco").Cells(Rows.Count, "A").End(xlUp).Row + 1
With Sheets("Master Supra").Range("B2:B" & LR)
.AutoFilter
.AutoFilter Field:=1, Criteria1:="#N/A"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy Destination:=Sheets("Supra Disco").Range("A2" & LR1)
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Application.Run "ABRAKADABRA"
End With
End Sub
Sub ABRAKADABRA()
'
' ABRAKADABRA Macro
'
'
Sheets("Data Creation").Activate
Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[71]=""Child"",VLOOKUP(RC[-1],'Master Supra'!R1:R1048576,1,FALSE),"""")"
Range("B2").Select
lastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("B2").AutoFill Destination:=Range("B2:B" & lastRow)
Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.Run "ADDNA"
End Sub
Sub ADDNA()
'For Move Entire Row to New Worksheet if Cell Contains Specific Text?
'Using autofilter to Copy rows that contain centain text to a sheet called Errors
Dim LR As Long
LR = Sheets("Data Creation").Cells(Rows.Count, "B").End(xlUp).Row
LR1 = Sheets("Master Supra").Cells(Rows.Count, "A").End(xlUp).Row + 1
With Sheets("Data Creation").Range("B2:B" & LR)
.AutoFilter
.AutoFilter Field:=1, Criteria1:="#N/A"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy Destination:=Sheets("Master Supra").Range(LR1)
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Application.Run "ABRAKADABRA"
End With
End Sub
This is the current code i', working with, and it somewhat works for the first maco sub, but i'm at least 80% sure that there is a waaay easier way to accomplish what i'm going for:
Okay so i spliced together 4 subs which the first 2 work (sometimes), but the last 2 do not?
My objective is simple, and you can use this as a reference: https://app.box.com/s/28q2ibnryvu60i8sayj0atbiza4m4qym
So here is the plan:
1. Vlookup column A in "Master Supra" to lookup sheet "Data Creation"
2. Anything that comes up #N/A move to "Supra Disco" & Delete from original sheet
3. Delete vlookup column
4. Vlookup Column A in "Data Creation" to lookup sheet "Master Supra"
5. Anything that comes up #N/A copy/paste to "Master Supra" WITH THE APPROPRIATE COLUMNS (highlighted yellow?) (KEEP IN ORIGINAL SHEET)
6. Delete vlookup column
*NOTE* i had not attempted moving the data from Data Creation -> Master Supra with the correct columns
I.E: "Title Generator" goes into "Item_Name", "Price Calc" goes into "Price". I'm not so lost that i can't figure out how to change the destionations of the cells, i just don't know VBA to this extent i've just been splicing VBA from things i find on the web.
Any and all help would be AMAZING
Bookmarks