ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Textbox accross worksheets - wont work! (https://www.excelbanter.com/excel-programming/413048-macro-textbox-accross-worksheets-wont-work.html)

EnquiringMind

Macro Textbox accross worksheets - wont work!
 
I've got info in cells in a workbook that has multiple worksheet.
I've created a macro that has mulitpage, and accesses and has to change
values in different sheets at different times. In most of the objects you can
just specify Worksheets2.Activate if you want sheet 2, but all the text boxes
reference to the cells in one sheet, so when the user uses the user form to
input a value - the right cell gets changed, but on the wrong sheet!

Anyone know how to specify the sheet number?
Would be greatly appreciated - this has sucked my time..


Sam Wilson

Macro Textbox accross worksheets - wont work!
 
You can use commands like

Worksheets("Sheet1").Range("a1").value =
Worksheets("Sheet2").Range("B2").value

so you can change any value in any worksheet and read from any value in a
work sheet, or combine both - is that any help?


"EnquiringMind" wrote:

I've got info in cells in a workbook that has multiple worksheet.
I've created a macro that has mulitpage, and accesses and has to change
values in different sheets at different times. In most of the objects you can
just specify Worksheets2.Activate if you want sheet 2, but all the text boxes
reference to the cells in one sheet, so when the user uses the user form to
input a value - the right cell gets changed, but on the wrong sheet!

Anyone know how to specify the sheet number?
Would be greatly appreciated - this has sucked my time..


JLGWhiz

Macro Textbox accross worksheets - wont work!
 
If you mean setting the ControlSource property try Sheet2!a2 or Sheet3!b4, etc.

"EnquiringMind" wrote:

I've got info in cells in a workbook that has multiple worksheet.
I've created a macro that has mulitpage, and accesses and has to change
values in different sheets at different times. In most of the objects you can
just specify Worksheets2.Activate if you want sheet 2, but all the text boxes
reference to the cells in one sheet, so when the user uses the user form to
input a value - the right cell gets changed, but on the wrong sheet!

Anyone know how to specify the sheet number?
Would be greatly appreciated - this has sucked my time..



All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com