Hi,
A little background on the goal of my Macro:
I have about 25 sheets each with identical tables (One table for every Sales Manager in the company). Due to poor data entry of the sales staff and the need for lookups in my workbook, I had to basically double the width of each table. So I paste into the right 10 columns, and columns A:J fill in with the TRIMmed data. When I'm done using/ updating these tables for managers, I need to move columns A:J into one master sheet that I call "AllData." I also need to delete all the columns to the right of A:J for the managers' convenience.
So step one is to paste columns A:J as values in the same cells they are already in. Here is what I have:
Sheets("Sheet1").Select
Range("A2:J2").Select
Range(Selection, Selection.End(xlDown)).Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
I can easily write this for each of the 25 sheets, but isn't the idea of variables to avoid having to copy and paste this code 25 times? How can I just write it so I say something like:
Variable work for Sheet1
Variable work for Sheet2
Variable work for Sheet3
and so on... "Variable" being the code for pasting values that I wrote above
I don't need a lesson on naming conventions either I understand the importance (people always seem to bring this up whether inquired or not when discussing variables)
Any and all help is appreciated!
Bookmarks