hello chaps.
Quick macro question for you...
I'm trying to copy some cells from one sheet to another using a macro.
You enter a week number, click a button, then it runs the macro based on the week number - which then goes to another sheet, and copies a column of cells from it to the active sheet.
So far i've got:
I realise this is very basic!
This looks at cell C2, and that's the week number.
Due to formatting in a sheet, it then adds 5 to this number, to get the correct column for which is wants to copy the data from.
This is as far as i've got.
The active cell is the top cell that i want to copy.
I want to copy this cell through to the one 65 cells below.
Any ideas?
I think i can work out then how to paste this into the other sheet.
Thanks!!
Quick macro question for you...
I'm trying to copy some cells from one sheet to another using a macro.
You enter a week number, click a button, then it runs the macro based on the week number - which then goes to another sheet, and copies a column of cells from it to the active sheet.
So far i've got:
Code:
Sub Picture1_Click()
Dim weeknumber As Integer
Dim weekcolumn As Integer
Dim from As Variant
Dim endrow As Integer
weeknumber = Range("C2").Value
MsgBox weeknumber
weekcolumn = weeknumber + 5
MsgBox weekcolumn
Cells(4, weekcolumn).Select
End Sub
I realise this is very basic!
This looks at cell C2, and that's the week number.
Due to formatting in a sheet, it then adds 5 to this number, to get the correct column for which is wants to copy the data from.
This is as far as i've got.
The active cell is the top cell that i want to copy.
I want to copy this cell through to the one 65 cells below.
Any ideas?
I think i can work out then how to paste this into the other sheet.
Thanks!!