Hi there,
I am having a bit of a brain freeze and was hoping that someone may be able to help me.
I am trying to write a VBA script that finds column "X" copies it across to column "X+1" and then pastes column "X" as values.
The formula that I have in a helper cell for determining column X is:
=IF(P5='Global Inputs'!$H$16,COLUMN(),"")
It would be great if someone could shed some light on the best way to make Q and P in the example below variable:
It seems as though it should be pretty straightforward to write a piece of code that says find column 16 copy it across to column 17 and then paste the original column 16 as values but for the life of me I can't work it out today!
Any help would be very much appreciated.
Thanks,
I am having a bit of a brain freeze and was hoping that someone may be able to help me.
I am trying to write a VBA script that finds column "X" copies it across to column "X+1" and then pastes column "X" as values.
The formula that I have in a helper cell for determining column X is:
=IF(P5='Global Inputs'!$H$16,COLUMN(),"")
It would be great if someone could shed some light on the best way to make Q and P in the example below variable:
Code:
Sub Roll()'
' Roll column
'
Selection.Copy
Columns("Q:Q").Select
ActiveSheet.Paste
Columns("P:P").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial
End Sub
It seems as though it should be pretty straightforward to write a piece of code that says find column 16 copy it across to column 17 and then paste the original column 16 as values but for the life of me I can't work it out today!
Any help would be very much appreciated.
Thanks,