Hi I have a worksheet with formula in F2 and G2. Column H is populated by data captured in a user form.
I would like to program the form to copy the the formula down to the the last row in the range.
For example if the user enters data and column H is then filled upto row 12 (this could be different every time) then I want the formula to copy down to row 12 in columns F and G!
I hope that makes sense.Can anybody help?
This is the code I have so far but it copys all the way down to the bottom of the work book,
Many thanks
Sub Macro6() ' Macro6 Macro Range("F2:G2").Select Selection.AutoFill Destination:=Range("F2:G65536") Range("F2:G65536").Select End Sub
Hi nods
It'll probably be something like thisJohnOption Explicit Sub Macro6() Dim LR As Long LR = Range("H" & Rows.Count).End(xlUp).Row Range("F2:G2").Select Selection.AutoFill Destination:=Range("F2:G" & LR) End Sub
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Does the userform enter one entry at a time?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks