Hi
Hopefully this is a simple thing to fix.
Been looking at this all morning and can't work out what I've done.
This is the beginning of a bit of code to go through a column of data, changing each cell to be 100% and then when it's copied and pasted it to another sheet, set it to 0% and the next cell to 100%.
Excel is coming up with a debugging error on the Range(PCT).Select part. Im sure I'm missing something entirley obvious.
Thanks for your help
Hopefully this is a simple thing to fix.
Been looking at this all morning and can't work out what I've done.
This is the beginning of a bit of code to go through a column of data, changing each cell to be 100% and then when it's copied and pasted it to another sheet, set it to 0% and the next cell to 100%.
Excel is coming up with a debugging error on the Range(PCT).Select part. Im sure I'm missing something entirley obvious.
Thanks for your help
Sub ExtractAll()
Dim PCT As Range, NextRow As Range
For x = 13 To 202
'go through population sheet
Set PCT = Range("D" & x)
Range(PCT).Select
ActiveCell.FormulaR1C1 = "100%"
'copy data
Sheets("Summary").Select
Range("2:2").Copy
'paste
Sheets("Compile").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
Dim PCT As Range, NextRow As Range
For x = 13 To 202
'go through population sheet
Set PCT = Range("D" & x)
Range(PCT).Select
ActiveCell.FormulaR1C1 = "100%"
'copy data
Sheets("Summary").Select
Range("2:2").Copy
'paste
Sheets("Compile").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste