Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
Hi
I am using the same code over and over again, each one has a few minor changes to it. Rather than do it like that I have worked out that if I place the changes onto a sheet and then reference to code to look there when it is run I can implement the changes. I have tested this and it work, however I have to implement the changes manually. Now I have done the following;
I have a userform on it I have a MultiPage (MultiPage1) and on each tab I have another MultiPage (MultiPage2). What I need help with is that when each page on MultiPage2 is ACTIVE it will automatically place data in column B on Sheet4.
The useform WILL NOT be opening on Sheet4
So when page 4 is Active data will go into Sheet4 Column B and the same for the others Page 5 and Page 6, i was testing this but could not get it to work
I am using the same code over and over again, each one has a few minor changes to it. Rather than do it like that I have worked out that if I place the changes onto a sheet and then reference to code to look there when it is run I can implement the changes. I have tested this and it work, however I have to implement the changes manually. Now I have done the following;
I have a userform on it I have a MultiPage (MultiPage1) and on each tab I have another MultiPage (MultiPage2). What I need help with is that when each page on MultiPage2 is ACTIVE it will automatically place data in column B on Sheet4.
The useform WILL NOT be opening on Sheet4
So when page 4 is Active data will go into Sheet4 Column B and the same for the others Page 5 and Page 6, i was testing this but could not get it to work
VBA Code:
Private Sub MultiPage2_Change()
'Test Code
If Page4 = True Then
Worksheets(Sheet4).Columns(2).ClearContents
Sheet4.Range("B1").Value = "one"
Sheet4.Range("B2").Value = "Two"
Sheet4.Range("B3").Value = "Three"
Sheet4.Range("B4").Value = "Four"
End If
If Page5 = True Then
Worksheets(Sheet4).Columns(2).ClearContents
Sheet4.Range("B1").Value = "Five"
Sheet4.Range("B2").Value = "Six"
Sheet4.Range("B3").Value = "Seven"
Sheet4.Range("B4").Value = "Eight"
End If
If Page6 = True Then
Worksheets(Sheet4).Columns(2).ClearContents
Sheet4.Range("B1").Value = "Nine"
Sheet4.Range("B2").Value = "Ten"
Sheet4.Range("B3").Value = "Eleven"
Sheet4.Range("B4").Value = "Twelve"
End If
End Sub