Clearing old data from Frames

Brawler

New Member
Joined
Jan 28, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello,
It worked so well last time I had a challenge, so now that I am faced my next challenge I will ask you guys again.
I have a frame with several textbox, dropdowns and optionbutton. Everything does what it is supposed to do, but allthough the controlsource cells are cleared, the old data remains in the Frame. I have found several posts with codes that should do exactly that, but when I try to pair it with my own code it gives error.

Here is the existing code:

VBA Code:
Sub Save_new_sparepart()
Saverange = Range("a10").Value
'
Range("A1:eek:1").Select
Selection.Copy
Range(Saverange).Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("a6").Select
Selection.Copy
Range("a5").Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("b3:eek:3").Select
Selection.Clear
Range("h4:h6").Select
Selection.Clear
ActiveSheet.Shapes("Frame1").Visible = False
End Sub

Could someone help me adding the additional code that would clear the Frame for old data.

(Extra question: If the Frame is cleared for old data, does that also clear the controlsource cells?)

-B
 
Last edited by a moderator:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top