VBA Modifcation

chally3

Board Regular
Joined
Mar 22, 2006
Messages
157
Good afternoon,

Could someone possibly help with amending the VBA below as our VBA guru has left our company.
All I need the amendment to be is in Column J add the comment "To be updated" (from cell J2 onwards for each row where there is data in the prior column)


Thank you



Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
      On Error GoTo ee
    Cells.Replace What:="SOLFILE.", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
        
     Range("A1").Select
    ActiveCell.FormulaR1C1 = "DUE DATE"
      Range("B1").Select
    ActiveCell.FormulaR1C1 = "SO NO"
      Range("C1").Select
    ActiveCell.FormulaR1C1 = "SO LINE"
      Range("D1").Select
    ActiveCell.FormulaR1C1 = "CUST"
      Range("E1").Select
    ActiveCell.FormulaR1C1 = "PART NO"
      Range("F1").Select
    ActiveCell.FormulaR1C1 = "DESCRIPTION"
      Range("G1").Select
    ActiveCell.FormulaR1C1 = "QTY"
      Range("H1").Select
    ActiveCell.FormulaR1C1 = "Q BOND"
      Range("I1").Select
    ActiveCell.FormulaR1C1 = "WO/PO NO"
      Range("J1").Select
    ActiveCell.FormulaR1C1 = "STATUS"
      Range("K1").Select
    ActiveCell.FormulaR1C1 = "ETA"
      Range("L").Select
    ActiveCell.FormulaR1C1 = "ACTION"
      
    

ee:
End Sub

Private Sub Workbook_Open()

End Sub
 
Last edited by a moderator:

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.
How about
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
   On Error GoTo ee
   Cells.Replace What:="SOLFILE.", Replacement:="", LookAt:=xlPart, _
      SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
      ReplaceFormat:=False
        
   Range("A1").Value = "DUE DATE"
   Range("B1").Value = "SO NO"
   Range("C1").Value = "SO LINE"
   Range("D1").Value = "CUST"
   Range("E1").Value = "PART NO"
   Range("F1").Value = "DESCRIPTION"
   Range("G1").Value = "QTY"
   Range("H1").Value = "Q BOND"
   Range("I1").Value = "WO/PO NO"
   Range("J1").Value = "To be updated"
   Range("K1").Value = "ETA"
   Range("L").Value = "ACTION"
      
    

ee:
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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