Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
Can anyone help me with some code please My data is in A1 to J1100 in column B there are random sequences of number 1 2 3 4 1 2 3 4 5 1 2 3 1 2 3 4 5 6 How can I select in column B the sequence 1 to 4 , then highlight B1 to J4 and save as a html file to c:\ With the file name always to the left of the 1, A1. A5, A10 etc, and when the code finishes goto B5 and start the code again. Thanks in advance Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like (totally untested, just to start you off):
Dim i As Long For i = 1 To 1097 Step 4 Set wb = Workbooks.Add Set ws = wb.ActiveSheet ThisWorkbook.ActiveSheet.Cells(i, 2).Resize(, 9).Copy ws.Cells(1, 1) wb.SaveAs Cells(i, 1), xlHtml wb.Close False Next __________________________________________________ ________________________ "DaveM" wrote in message . uk... Hi all Can anyone help me with some code please My data is in A1 to J1100 in column B there are random sequences of number 1 2 3 4 1 2 3 4 5 1 2 3 1 2 3 4 5 6 How can I select in column B the sequence 1 to 4 , then highlight B1 to J4 and save as a html file to c:\ With the file name always to the left of the 1, A1. A5, A10 etc, and when the code finishes goto B5 and start the code again. Thanks in advance Dave |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help
run-time error 1004 in debug below was highlighted yellow wb.SaveAs Cells(i, 1), xlHtml a new workbook was created with data from another location than selected. "Vasant Nanavati" <vasantn AT aol DOT com wrote in message ... Something like (totally untested, just to start you off): Dim i As Long For i = 1 To 1097 Step 4 Set wb = Workbooks.Add Set ws = wb.ActiveSheet ThisWorkbook.ActiveSheet.Cells(i, 2).Resize(, 9).Copy ws.Cells(1, 1) wb.SaveAs Cells(i, 1), xlHtml wb.Close False Next __________________________________________________ ________________________ "DaveM" wrote in message . uk... Hi all Can anyone help me with some code please My data is in A1 to J1100 in column B there are random sequences of number 1 2 3 4 1 2 3 4 5 1 2 3 1 2 3 4 5 6 How can I select in column B the sequence 1 to 4 , then highlight B1 to J4 and save as a html file to c:\ With the file name always to the left of the 1, A1. A5, A10 etc, and when the code finishes goto B5 and start the code again. Thanks in advance Dave |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does column A contain the fully-qualified filename that you want to save the
file as? With the full path? __________________________________________________ ______________________ "DaveM" wrote in message ... Thanks for your help run-time error 1004 in debug below was highlighted yellow wb.SaveAs Cells(i, 1), xlHtml a new workbook was created with data from another location than selected. "Vasant Nanavati" <vasantn AT aol DOT com wrote in message ... Something like (totally untested, just to start you off): Dim i As Long For i = 1 To 1097 Step 4 Set wb = Workbooks.Add Set ws = wb.ActiveSheet ThisWorkbook.ActiveSheet.Cells(i, 2).Resize(, 9).Copy ws.Cells(1, 1) wb.SaveAs Cells(i, 1), xlHtml wb.Close False Next __________________________________________________ ________________________ "DaveM" wrote in message . uk... Hi all Can anyone help me with some code please My data is in A1 to J1100 in column B there are random sequences of number 1 2 3 4 1 2 3 4 5 1 2 3 1 2 3 4 5 6 How can I select in column B the sequence 1 to 4 , then highlight B1 to J4 and save as a html file to c:\ With the file name always to the left of the 1, A1. A5, A10 etc, and when the code finishes goto B5 and start the code again. Thanks in advance Dave |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All OK Thanks Vasant
"Vasant Nanavati" <vasantn AT aol DOT com wrote in message ... Does column A contain the fully-qualified filename that you want to save the file as? With the full path? __________________________________________________ ______________________ "DaveM" wrote in message ... Thanks for your help run-time error 1004 in debug below was highlighted yellow wb.SaveAs Cells(i, 1), xlHtml a new workbook was created with data from another location than selected. "Vasant Nanavati" <vasantn AT aol DOT com wrote in message ... Something like (totally untested, just to start you off): Dim i As Long For i = 1 To 1097 Step 4 Set wb = Workbooks.Add Set ws = wb.ActiveSheet ThisWorkbook.ActiveSheet.Cells(i, 2).Resize(, 9).Copy ws.Cells(1, 1) wb.SaveAs Cells(i, 1), xlHtml wb.Close False Next __________________________________________________ ________________________ "DaveM" wrote in message . uk... Hi all Can anyone help me with some code please My data is in A1 to J1100 in column B there are random sequences of number 1 2 3 4 1 2 3 4 5 1 2 3 1 2 3 4 5 6 How can I select in column B the sequence 1 to 4 , then highlight B1 to J4 and save as a html file to c:\ With the file name always to the left of the 1, A1. A5, A10 etc, and when the code finishes goto B5 and start the code again. Thanks in advance Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Where does Excel2007 save files -- not where I select? | Excel Worksheet Functions | |||
Help with, Select then Save as | Excel Programming | |||
Code for Select a file and save it in a different location | Excel Programming | |||
User select Save To Folder | Excel Programming | |||
Save RAND select number | Excel Discussion (Misc queries) |