Data_Admin Posted June 16, 2017 Posted June 16, 2017 Hello all, I recently attended the SIMS advanced reporting with excel analysis training course and have been having a play with some attendance reports. I managed to use the following code to copy a formula down the required amount of cells in my student data tab. Sheets("Student Data").Select Dim r As Integar r = ActiveSheet.Range("A1").End(xlDown).Row Range("p2")Select Selection.AutoFill Destination:=Range("p2:p"&r) I have tried a few different ways to get this to work for multiple (6) different columns but am still struggling to get it to happen. I have a Compile error message which stated 'Wrong number of arguments or invalid property assignment'. Any suggestions gratefully received. Olivia
mukz Posted June 16, 2017 Posted June 16, 2017 Hello all, I recently attended the SIMS advanced reporting with excel analysis training course and have been having a play with some attendance reports. I managed to use the following code to copy a formula down the required amount of cells in my student data tab. Sheets("Student Data").Select Dim r As Integar r = ActiveSheet.Range("A1").End(xlDown).Row Range("p2")Select Selection.AutoFill Destination:=Range("p2:p"&r) I have tried a few different ways to get this to work for multiple (6) different columns but am still struggling to get it to happen. I have a Compile error message which stated 'Wrong number of arguments or invalid property assignment'. Any suggestions gratefully received. Olivia Sheets("student Data").Select Dim r As Integer r = ActiveSheet.Range("A1").End(xlDown).Row Range("H2").Select Selection.AutoFill Destination:=Range("H2:H" & r) Range("J2").Select Selection.AutoFill Destination:=Range("J2:J" & r) Range("D2").Select Selection.AutoFill Destination:=Range("D2:D" & r) Range("E2").Select Selection.AutoFill Destination:=Range("E2:E" & r) Range("F2").Select Selection.AutoFill Destination:=Range("F2:F" & r) this is how i did my one for our school. Regards Mukesh 1
Data_Admin Posted June 16, 2017 Author Posted June 16, 2017 Works an absolute treat! Many thanks Mukesh. I like the smiley emoji in your code. Olivia
SamanthaD Posted June 20, 2017 Posted June 20, 2017 Hi Olivia, I'm no programmer - but would the fact you've spelt integer with an a not an e be a contributing factor as to why your original code didn't work? Sam.
Data_Admin Posted June 27, 2017 Author Posted June 27, 2017 Hi Sam, that was just a typo in this message it was spelt correctly in excel code. I don't think it would have worked at all with a typo in code. Always something to be mindful of though. Thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now