@soche123, your attitude stinks. We don't care if you NEED this badly. You have failed to do anything to help yourself. Guess what, if you're planning a career in programming being able to think for yourself is an absolute must.
You clearly do not understand the elements of simple logic and for loops. That in itself isn't a problem. It's tricky for first timers. What I suggested was to draw a flow chart to help you understand it, visualise it.
That should be your next step, specifically look at the flow chart for a nested for loop.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...