austenr
07-23-2015, 11:15 AM
I want to modify the following code to be able to just select worksheets in a named range called "Contacts". If the sheet isn't in the range I do not want to select it.
For Each sht In wkbk.Worksheets
newWorkbook = SaveWorksheet(sht, folder)
' in here you could read some parts of your worksheet to determine where to send it
PostMsg "My subject", "My body", "someone@somewhere.com", newWorkbook
' Kill newWorkbook
Next sht
For Each sht In wkbk.Worksheets
newWorkbook = SaveWorksheet(sht, folder)
' in here you could read some parts of your worksheet to determine where to send it
PostMsg "My subject", "My body", "someone@somewhere.com", newWorkbook
' Kill newWorkbook
Next sht