Link to home
Start Free TrialLog in
Avatar of W.E.B
W.E.B

asked on

VBA Excel Insert

Hello,
can you please help,

I need to find the last Rows Used in Column "D",
then   add a 5 comments into Column "E"   2 rows after last Row found..

Thanks for any help.
Sample.xlsx
SOLUTION
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

You can use the following code on the Sheet you wish you add the comments to.

Option Explicit

Private Sub EnterComments()
    With Range("D1048576").End(xlUp)
        .Offset(3, 1).Value = "Comment 1"
        .Offset(4, 1).Value = "Comment 2"
        .Offset(5, 1).Value = "Comment 3"
        .Offset(6, 1).Value = "Comment 4"
        .Offset(7, 1).Value = "Comment 5"
    End With
End Sub

Open in new window

see attached
Sample.xlsm
Avatar of W.E.B
W.E.B

ASKER

Hello,
appreciate your fast help.

the comments are not the same.
each line has a different comment.

thanks
ASKER CERTIFIED SOLUTION
Avatar of [ fanpages ]
[ fanpages ]

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
...each line has a different comment

Each of us (!) has chosen to display five comments numbered from 1 to 5.

You simply need to replace the text for each Comment as shown above with the text that you require.

FamousMortimer's code, & my proposal, make that task an easier process.
Avatar of W.E.B

ASKER

Thank you very much guys.
Appreciate all your time and help.
You are very welcome.

However, did you intend to miss FamousMortimer from the allocation of points?

I think he would appreciate some feedback about his solution in any respect.