Adding 4 rows after each total criteria in the column A with formatting and added text using macro.
Hi
I'm not sure exactly what you are wanting to do, from the original
description it sounds like you have a cell that appears every so often
in the column A with the value of "total"??? if this is the case you
can run the code from a button or you can assign a keyboard shortcut
to it.
you can do the latter by opening the visual basic editor or press Alt
and F11 then add a new module then paste the given code into the
module just change the line
Private Sub CommandButton1_Click()
to something like
Sub RunMyCode()
then in excel from the tools menu select the macro option, from the
Form that pops up high light your macro RunMyCode then select the
options button and add a shortcut key.
then you will be able to run the code from this shortcut.
if you don't have the cell value of "total" to mark where you are
wanting the changes to be made you will have to search for something
that will indicate which cells to run the code from, i.e. if the total
is always have 5 cells between you could use that to activate your
code.
also if you are doing this in different workbooks every time you may
have to do something like create a workbook with the code you want to
run then add a little bit of code to open the other workbook and then
run the code on that workbook as having to add the code every time is
very impractical.
hope this is somewhat clearer
|