Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for moving textbox
I want to use a macro to shift a text box from one
position to another on the sheet. I was given the following code: Sheet1.TextBox1.Top=Sheet1.Range("B2").Top Sheet1.TextBox1.Left=Sheet1.Range("B2").Left When I execute the macro I get the message METHOD OR DATA MEMBER NOT FOUND Can someone advise what I am doing wrong here Your help will be appreciated. Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for moving textbox
The only case where I get this error message is where TextBox1 doesn't exist
on Sheet1 in the workbook where the macro finds a Sheet1. Since most every workbook has a Sheet1, I suggest you be more explicit about which Sheet1 you mean by specifying the workbook. Here is one way: Sub moveit() With Workbooks("Book1.xls").Worksheets("Sheet1") .TextBox1.Top = Sheet1.Range("B2").Top .TextBox1.Left = Sheet1.Range("B2").Left End With End Sub Bob Kilmer "Phil Perry" wrote in message ... I want to use a macro to shift a text box from one position to another on the sheet. I was given the following code: Sheet1.TextBox1.Top=Sheet1.Range("B2").Top Sheet1.TextBox1.Left=Sheet1.Range("B2").Left When I execute the macro I get the message METHOD OR DATA MEMBER NOT FOUND Can someone advise what I am doing wrong here Your help will be appreciated. Thank you |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for moving textbox
The code worked fine for me.
Regards, Tom Ogilvy "Phil Perry" wrote in message ... I want to use a macro to shift a text box from one position to another on the sheet. I was given the following code: Sheet1.TextBox1.Top=Sheet1.Range("B2").Top Sheet1.TextBox1.Left=Sheet1.Range("B2").Left When I execute the macro I get the message METHOD OR DATA MEMBER NOT FOUND Can someone advise what I am doing wrong here Your help will be appreciated. Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate Textbox value based on another textbox value.doc | Excel Discussion (Misc queries) | |||
Calculate Textbox value based on another textbox value | Excel Discussion (Misc queries) | |||
CODE 4 MOVING WITHIN A RANGE-TAB | Excel Discussion (Misc queries) | |||
Arrow Keys Moving Window Frame instead of Moving Between Cells | Excel Discussion (Misc queries) | |||
Need VBA code to enter text into a textbox !!!! | Excel Discussion (Misc queries) |