Forum Discussion
Use VBA to Autofill a Row until the end of the number of data in another row
- Mar 25, 2019
Hi Haytham Amairah,
I was facing similar issues and chanced upon this thread. If i have two columns (O and P) that i wish to autofill via VBA, do I amend the code from:
Selection.AutoFill Destination:=Range("O2:P313")
Range("O2:P313").Selectto:
Selection.AutoFill Destination:=Range("O2:O" & Range("E" & Rows.Count).End(xlUp).Row)
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFill Destination:=Range("P2:" & Range("E" & Rows.Count).End(xlUp).Row)
Range(Selection, Selection.End(xlDown)).Select
Hi,
I think there are some issues in your original workbook!
If you can attach it or a sample of it, this will be helpful.
It's a Photo of my Problem:
And there would attach a DataExample (February) and the Code in other Sheet.
I've test February in the Original Excel, in other Excel and in the Test Excel and it don't work :S.
Thanks by your time.
- Haytham AmairahApr 23, 2020Silver Contributor
Hi,
After inspecting the code, I found some lines that delete the last records!
However, I've turned them to comments in the code.
Hope that helps
- Mauriq25Apr 23, 2020Copper Contributor
Hello,
Can I say that I love you?
Thanks bro!!! I never find that there was some "Deleting Codes", I've made it by macros and then Editing hehehe.
I'll still working in it and somes futures dudes I'll tell you ;).
Have a nice day.
- Haytham AmairahApr 23, 2020Silver Contributor