SimonGeoghegan
Board Regular
- Joined
- Nov 5, 2013
- Messages
- 68
Hi All,
I recently created a number of files for different departments - it has since been identified that one of the macros within these spreadsheets is slightly wrong and needs amending.
The NEW macro is as follows;
I want to add the follow line into the existing macro within each workbook;
RangeActiveCell.Offset(0,1).Address,"J" & LastRow).ClearContents
Does anyone know if there is a way of doing this via a macro? The workbooks are all in various different folders/subfolders but if I can add a button to my Excel ribbon that runs code to add the above, that would be great.
I've had a look on the search but most fixes seem to look at importing the module and wasn't sure what impact this may have for me.
Any help greatly appreciated!
Regards,
Simon
I recently created a number of files for different departments - it has since been identified that one of the macros within these spreadsheets is slightly wrong and needs amending.
The NEW macro is as follows;
PHP:
Sub AddLinesActionPlan()
Dim LastRow As Long
Range("B7:K26").Copy
Range("B6").End(xlDown).Offset(1, 0).PasteSpecial
LastRow = Range("B" & Rows.Count).End(xlUp).Row
Range(ActiveCell.Offset(0, 1).Address, "J" & LastRow).ClearContents
Range("B7").AutoFill Destination:=Range("B7:B" & LastRow), Type:=xlFillSeries
Range("A1").Select
MsgBox ("20 additional lines now added.")
End Sub
I want to add the follow line into the existing macro within each workbook;
RangeActiveCell.Offset(0,1).Address,"J" & LastRow).ClearContents
Does anyone know if there is a way of doing this via a macro? The workbooks are all in various different folders/subfolders but if I can add a button to my Excel ribbon that runs code to add the above, that would be great.
I've had a look on the search but most fixes seem to look at importing the module and wasn't sure what impact this may have for me.
Any help greatly appreciated!
Regards,
Simon