I have an excel spreadsheet with text at the top of each column, which I want to link to a macro which when clicked will copy the contents of the column before it.
The only macro I know how to do that does this is below
However doing it this way would mean I would need one macro for each of my columns (and there are a lot) and I would need to go in and change each letters accordingly. Is there away I can change the macro so it knows what columns to copy and paste from regardless of which Column the macro is running from? So I would want to copy from the column before the one where I am clicking the text, to this one.
Any help is appreciated
Thanks
John
"The only stupid question is the one that doesn't get asked
The only macro I know how to do that does this is below
Code:
Sub TestCopyCollum()
'
' TestCopyCollum Macro
' Macro recorded 08/12/2006 by John O'Boyle
'
'
Columns("B:B").Select
Selection.Copy
Columns("C:C").Select
ActiveSheet.Paste
End Sub
However doing it this way would mean I would need one macro for each of my columns (and there are a lot) and I would need to go in and change each letters accordingly. Is there away I can change the macro so it knows what columns to copy and paste from regardless of which Column the macro is running from? So I would want to copy from the column before the one where I am clicking the text, to this one.
Any help is appreciated
Thanks
John
"The only stupid question is the one that doesn't get asked