Hi Folks,
I need some help constructing some VBA code which will do the following:
Basically I have a web query which imports a 4-column table data (with variable rows and/or variable numbers of tables with variable numbers of rows!) from a webpage, I need to copy and paste this into another worksheet and space each column of data out so it can be merged across multiple columns to make it easier to read. The original web query import is in full HTML, so this imports the table formatting as well - and the background colour in particular must be copied across as this is the part (along with text) most likely to change.
The only constant on the web import query is that the range I want to copy starts with a cell in col A which has the text "For Model [model #]" (there may be more than one instance of this!) and the last cell I want to copy is the row before the cell which has text "Key" in it.
Any code/suggestions/assistance would be fantastic! Thanks in advance
LolaM
I need some help constructing some VBA code which will do the following:
- Search col A of Sheet1 for the first instance of a specific text string (which starts "For Model" with potentially multiple returns, e.g. "For Model 1234", "For Model 4567", etc).
- Stop search at cell in col A containing the word "Key".
- Copy all of the cells in col A between these two cells found in the 2 steps above.
- Paste values and formatting - especially cell pattern - to cell A1 on Sheet2.
- THEN... from the first instance of the text found in step 1 above, copy and paste col B for the same range of cells to Sheet2, cell E1.
- THEN... from the first instance of the text found in step 1 above, copy and paste col C for the same range of cells to Sheet2, cell J1.
- THEN... from the first instance of the text found in step 1 above, copy and paste col D for the same range of cells to Sheet2, cell O1.
Basically I have a web query which imports a 4-column table data (with variable rows and/or variable numbers of tables with variable numbers of rows!) from a webpage, I need to copy and paste this into another worksheet and space each column of data out so it can be merged across multiple columns to make it easier to read. The original web query import is in full HTML, so this imports the table formatting as well - and the background colour in particular must be copied across as this is the part (along with text) most likely to change.
The only constant on the web import query is that the range I want to copy starts with a cell in col A which has the text "For Model [model #]" (there may be more than one instance of this!) and the last cell I want to copy is the row before the cell which has text "Key" in it.
Any code/suggestions/assistance would be fantastic! Thanks in advance
LolaM