Hi, I am new to Excel VBA
Problem - I have 3 tabsheets (All,Form461-0013,Rev01,Cost estimate). In each sheet ,i have one update button . How i can combine these "update" buttons in one single "update"button in the userform. so when you click the update button on userform. All the 3 sheets will automatically get updated !!
Please help me !
**Below codes are from 3 different sheet's Private SUB ()
'All' sheet code
Range("F4795:F8000").FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-2],YC55!C[-5]:C[-2],4,0),"""")" '' update Product hirechy column
Range("K4795:K8000").FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-6],'Flow Description'!C[-10]:C[-8],3,FALSE),"""")" ''update Flow description coloumn
'Form461-0013,Rev01' code
Dim LastRow As Long
Dim FirstRow As Long
Dim MaxRow As Long
Sheets("Form461-0013,Rev01").Range("C8:D23").ClearContents
With Sheets("All")
LastRow = .Cells(Rows.Count, 4).End(xlUp).Row
FirstRow = .Cells(Rows.Count, 3).End(xlUp).Row
.Columns("C:C").Insert
.Range("C4795:C" & LastRow).FormulaR1C1 = "=IF(AND(RC[1]<>"""",RC[2]<>""""),ROW(),"""")"
MaxRow = .Application.WorksheetFunction.Max(.Range("C:C"))
.Columns("C:C").Delete
.Range("D" & MaxRow & ":E" & LastRow).Copy
Sheets("Form461-0013,Rev01").Range("C8").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End With
'Cost estimate' code
Range("A25:A40").FormulaR1C1 = "='Form461-0013,Rev01'!R[-17]C[2]" ''UPDATE NEW MATERIAL COLUMN
Range("B25:B40").FormulaR1C1 = "='Form461-0013,Rev01'!R[-17]C[2]" ''UPDATE NEW PART ID COLUMN
Range("C25:C40").FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-2],YC55!C[-2]:C[1],4,0),"""")" ''UPDATE HIRERACHY COLUMN
Bookmarks