Private Sub CLend_Change()
If Not CLstart = "" And Not CLend = "" And Not CLstep = "" Then
CMB_Generate2.Enabled = True
Else
CMB_Generate2.Enabled = False
End If
End Sub
Private Sub CLstart_Change()
If Not CLstart = "" And Not CLend = "" And Not CLstep = "" Then
CMB_Generate2.Enabled = True
Else
CMB_Generate2.Enabled = False
End If
End Sub
Private Sub CLstep_Change()
If Not CLstart = "" And Not CLend = "" And Not CLstep = "" Then
CMB_Generate2.Enabled = True
Else
CMB_Generate2.Enabled = False
End If
End Sub
Private Sub CMB_Close_Click()
Unload Me
End Sub
Private Sub CMB_Generate2_Click()
'**code to get message when WD1 isn't filled in
If Not CLstart = "" And Not CLend = "" And Not CLstep = "" And WD1 = "" Then
MsgBox "fill in at least 1 Waterdepth"
Exit Sub
Else
End If
'**code to get A&R waterdepths
ActiveSheet.Cells(6, 24).Value = WD1.Value
ActiveSheet.Cells(11, 3).Value = WD1.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
If Not WD2.Value = "" Then
ActiveSheet.Cells(7, 24).Value = WD2.Value
ActiveSheet.Cells(11, 3).Value = WD2.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD3.Value = "" Then
ActiveSheet.Cells(8, 24).Value = WD3.Value
ActiveSheet.Cells(11, 3).Value = WD3.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD4.Value = "" Then
ActiveSheet.Cells(9, 24).Value = WD4.Value
ActiveSheet.Cells(11, 3).Value = WD4.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD5.Value = "" Then
ActiveSheet.Cells(10, 24).Value = WD5.Value
ActiveSheet.Cells(11, 3).Value = WD5.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD6.Value = "" Then
ActiveSheet.Cells(11, 24).Value = WD6.Value
ActiveSheet.Cells(11, 3).Value = WD6.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD7.Value = "" Then
ActiveSheet.Cells(12, 24).Value = WD7.Value
ActiveSheet.Cells(11, 3).Value = WD7.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD8.Value = "" Then
ActiveSheet.Cells(13, 24).Value = WD8.Value
ActiveSheet.Cells(11, 3).Value = WD8.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD9.Value = "" Then
ActiveSheet.Cells(14, 24).Value = WD9.Value
ActiveSheet.Cells(11, 3).Value = WD9.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
If Not WD10.Value = "" Then
ActiveSheet.Cells(15, 24).Value = WD10.Value
ActiveSheet.Cells(11, 3).Value = WD10.Value
'**code to get information from user
loopstep = CLstep
'**code to resolve any problems with wdend, wdstart, loopinterval
For i = CLstart To CLend Step loopstep
ActiveSheet.Cells(28, 3).Value = i
'** code to build filename and write text file
DoTheExport
Next i
DoTheExport
Unload Me
Else
Unload Me
End If
End Sub
is there a way to write this ''shorter''?
Bookmarks