LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Linking Button to a cell


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Macro to Button? Jo[_2_] Excel Discussion (Misc queries) 1 August 2nd 07 08:44 PM
Button linking to another cell and sheet SouthernBoy718 Links and Linking in Excel 0 January 7th 07 12:15 AM
Inserting a button into a cell and linking it to a macro Robb W Excel Discussion (Misc queries) 3 May 2nd 06 09:04 PM
Linking a Macro to a Button bman342 Excel Discussion (Misc queries) 3 April 10th 06 03:35 AM
Linking Option button together cbh35711 Excel Discussion (Misc queries) 10 January 9th 06 08:51 PM


All times are GMT +1. The time now is 09:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"