Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Insert row then format cell in new row

Status
Not open for further replies.

CEMrob

Programmer
Sep 2, 2008
24
GB
Excel 2003 / WinXP. I have a list object with 5 columns, A - E, and all cells have a border round them. I need a macro which will:
1. insert a row below the current row (whatever cell happens to be selected when the macro is triggered by the user)
2. then remove the left hand border of the cell in column B in the new row,
3. then select the adjacent cell in column C in the new row ready for data entry.
Obviously I cannot specify any absolute addresses in the code, and this is where all my attempts to record a suitable macro fall down. All suggestions gratefully received.
(Might be very easy, but VB programming experience practically nil, so sorry and thanks!)
 
How about you record a macro, start amending it as you require (Tip: look into ActiveCell.Row). Then post back when you get stuck?

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Thank you for the suggestion. I had tried doing that, but the problem is that I have little knowledge of VBA and don't know what object methods and properties are available, or what the syntax might be. This means that I do not know how to modify the 'recorded' generated code which uses specific row, column, cell addressing etc to more appropriate code to make it relative. I very much appreciate that users of these forums should not expect others to do their thinking for them and should do at least a little work first!

I have followed up your tip and, with a little help from elsewhere, have now resolved the issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top