M
MarcB
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
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