Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have 20 or so lines, each have a button next to them. If the use clicks the button a line is inserted below the line the button is on In theory this is a great idea, but the problem is that the butto actions are linked to cells so once one line is added the rest ar messed up. What I need is to be able to somehow code in vba the abilit for the button to realize what line it is on so that it can generate "I'm on line X, so I'll enter a blank line on X+1" instead of "I'm o line C so I'll enter a new line on D". If there is a easy way to do this I would really appreciate your input My button clicking code looks like this: Private Sub Button23_click() ' ' linebylinenotes Macro ' Macro recorded 10/1/2004 by mbryant ' ' Selection.EntireRow.Insert Range("C20:I20").Select With Selection .Orientation = 0 .AddIndent = False .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = True End With Range("B21").Select ActiveCell.FormulaR1C1 = "Notes" With ActiveCell.Characters(Start:=1, Length:=5).Font .Name = "Arial" .FontStyle = "Bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Range("C22:F22").Select End Sub Any help would be greatly appreciated -- Marc ----------------------------------------------------------------------- MarcB's Profile: http://www.excelforum.com/member.php...fo&userid=1498 View this thread: http://www.excelforum.com/showthread.php?threadid=26608 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking Macro to Button? | Excel Discussion (Misc queries) | |||
Button linking to another cell and sheet | Links and Linking in Excel | |||
Inserting a button into a cell and linking it to a macro | Excel Discussion (Misc queries) | |||
Linking a Macro to a Button | Excel Discussion (Misc queries) | |||
Linking Option button together | Excel Discussion (Misc queries) |