Young Grasshopper
Board Regular
- Joined
- Dec 9, 2022
- Messages
- 58
- Office Version
- 365
- 2016
- Platform
- Windows
Hi world,
I have a bunch of text boxes grouped together with other objects, and want to write a code that referance the grouped objects trough a long variable.
The grouped objects is named "PreviewGroup1", and have a text box called "HeadlinesPreview" grouped toghether with multiple other stuff.
Let's say I want to make a with statment. I'm trying to do something like this:
But I only get error messages...
How should this with statment be?
Also;
Let's say i have multiple groups called PreviewGroup1, PreviewGroup2, PreviewGroup3, PreviewGroup4 etc.
would it be possible to referance them trough a Long variable like:
This above probobly don't make sense, but hopefully explains somewhat what I'm trying to say.
Would appreciate any help
I have a bunch of text boxes grouped together with other objects, and want to write a code that referance the grouped objects trough a long variable.
The grouped objects is named "PreviewGroup1", and have a text box called "HeadlinesPreview" grouped toghether with multiple other stuff.
Let's say I want to make a with statment. I'm trying to do something like this:
VBA Code:
Sub Preview()
With ThisWorkbook.Worksheets("CustomerPreview").Shapes("PreviewGroup1")
.Shapes("HeadlinesPreview").TextFrame.Characters.Text = "x"
End with
End
But I only get error messages...
How should this with statment be?
Also;
Let's say i have multiple groups called PreviewGroup1, PreviewGroup2, PreviewGroup3, PreviewGroup4 etc.
would it be possible to referance them trough a Long variable like:
VBA Code:
Dim i as Long
For i = 1 to 10
With ThisWorkbook.Worksheets("CustomerPreview").Shapes("PreviewGroup(i)")
This above probobly don't make sense, but hopefully explains somewhat what I'm trying to say.
Would appreciate any help