I have two seperate pieces of code that work, but I need to
get them to loop through a list and use the list in saving as filename.
But I've no idea how to use the filename or create the loop through the list
so Im here looking for a kind soul willing to help.
Sheet4 B7 is the start of a named range "ListItems" I have code to copy
to where I want, but dont know how to add a loop to go through the list
So after each copy I need to do run the next bit of code.
If I put the two together they are ok, but I have to keep changing the file name
every time I run it.
I dont know how to loop through the list or use B7 to add to the filename
Anyone able to help??
get them to loop through a list and use the list in saving as filename.
But I've no idea how to use the filename or create the loop through the list
so Im here looking for a kind soul willing to help.
Sheet4 B7 is the start of a named range "ListItems" I have code to copy
to where I want, but dont know how to add a loop to go through the list
Code:
Sheets("Sheet4").Range("B7").Copy Sheets("Sheet1").Range("B7")
So after each copy I need to do run the next bit of code.
If I put the two together they are ok, but I have to keep changing the file name
every time I run it.
I dont know how to loop through the list or use B7 to add to the filename
Code:
Sub SAVEASHTML()
Sheets("Sheet1").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, "C:\test\List1_Page.htm", _
"Sheet1", "", xlHtmlStatic, "Book2", "")
.Publish (True)
.AutoRepublish = False
End With
Sheets("Sheet2").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, "C:\test\List1_Page2.htm", _
"Sheet2", "", xlHtmlStatic, "Book2", "")
.Publish (True)
.AutoRepublish = False
End WithEnd Sub
Anyone able to help??