I have a task that I have to repeat on a weekly basis and it is very time-consuming. I a newbie when it comes to VBA so any help is gladly appreciated! I am trying to select a range of cells and special paste values. I have been using the record macros button to get the code I need; however, when I add new clients to the list the code is not dynamic.
My current data range is A10:AX586. I need a code that will allow me to select that range copy and paste special values only. Here is the code I am currently using.
Range("A10").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
The problem I am running into is that the last 3 rows in my data set are totals and need to stay formulas. How can I rewrite this code to select all the data dynamically but exclude the last 3 rows? I have tried to work offset into my code but I am not sure how to write it. Any help is greatly appreciated. Thanks in advance!!
My current data range is A10:AX586. I need a code that will allow me to select that range copy and paste special values only. Here is the code I am currently using.
Range("A10").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
The problem I am running into is that the last 3 rows in my data set are totals and need to stay formulas. How can I rewrite this code to select all the data dynamically but exclude the last 3 rows? I have tried to work offset into my code but I am not sure how to write it. Any help is greatly appreciated. Thanks in advance!!