Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() how can i code in vba xy positions of textboxes on a worksheet according to a cell reference? e.g. textbox1 is aligned with cell a1, textbox2 is aligned with cell c1, etc. thanks. -- dreamz ------------------------------------------------------------------------ dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462 View this thread: http://www.excelforum.com/showthread...hreadid=481957 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Sub FitObjectToRange(MyObject As Object, MyLocation As Range)
MyObject.Top = MyLocation.Top MyObject.Left = MyLocation.Left MyObject.Width = MyLocation.Width MyObject.Height = MyLocation.Height End Sub Example of use: FitObjectToRange ActiveSheet.TextBox1, Range("A1") FitObjectToRange ActiveSheet.TextBox2, Range("C1") MyObject can be any object that has a .top, .left, .width, and .height (e.g. commandbuttons, images, ...) MyLocation can be a cell or a range of cells -- - K Dales "dreamz" wrote: how can i code in vba xy positions of textboxes on a worksheet according to a cell reference? e.g. textbox1 is aligned with cell a1, textbox2 is aligned with cell c1, etc. thanks. -- dreamz ------------------------------------------------------------------------ dreamz's Profile: http://www.excelforum.com/member.php...o&userid=26462 View this thread: http://www.excelforum.com/showthread...hreadid=481957 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reference Tab name to two textboxes | Excel Discussion (Misc queries) | |||
Aligning decimal numers to the centre of the cell and aligning dec | Excel Discussion (Misc queries) | |||
Aligning Reference numbers | Excel Discussion (Misc queries) | |||
Copying multiline textboxes from userform to worksheet cell | Excel Programming | |||
how do I link Textboxes in a userform to a Cell in a Worksheet? | Excel Programming |