Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro copy of variable ranges in one sheet to table in another she
I am trying to make a "simple to use" way of generating buy-requisitions and
reccording the individual purchases in a table. Each requisition will have 1 to 20 lines (rows) and each line will consist of 12 cells. 2 of the cells are keyed in manually the rest are generated ( "IF" / "VLOOKUP" /etc). First cell in first line/row is A14 - last cell in first row is L14. Last cell in last row is in column L, but may be any of the rows 14 to 33. Making the lines in the requisition is no problem. My problem occurs when I try to reccord a macro that finds and selects range. I have used END, UP/DOWN/LEFT/RIGHT and SHIFT in various sequenses - Then COPY and at destination PASTE SPECIAL / VALUES. It works when done manually, but when macro-reccorded the ranges are fixed (absolute) and the execution of the macro does not adapt to the actual number of lines in the requisition. Next similar problem comes when I try to locate the end of the table to which the copied lines should be added. Here too it works manually, but when reccorded in macro "it freezes the positions" and does not find the actual last line/cell in the table as the table grows. I am not more than superficially familiar with VBA so I am not able to write code directly by myself. I can imagine that some loops finding the borders af an area and the last row may be needed, but I hope it may be solved mainly by reccording macro. Please help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro copy of variable ranges in one sheet to table in another she
See this page Kaare
http://www.rondebruin.nl/copy1.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Kaare" wrote in message ... I am trying to make a "simple to use" way of generating buy-requisitions and reccording the individual purchases in a table. Each requisition will have 1 to 20 lines (rows) and each line will consist of 12 cells. 2 of the cells are keyed in manually the rest are generated ( "IF" / "VLOOKUP" /etc). First cell in first line/row is A14 - last cell in first row is L14. Last cell in last row is in column L, but may be any of the rows 14 to 33. Making the lines in the requisition is no problem. My problem occurs when I try to reccord a macro that finds and selects range. I have used END, UP/DOWN/LEFT/RIGHT and SHIFT in various sequenses - Then COPY and at destination PASTE SPECIAL / VALUES. It works when done manually, but when macro-reccorded the ranges are fixed (absolute) and the execution of the macro does not adapt to the actual number of lines in the requisition. Next similar problem comes when I try to locate the end of the table to which the copied lines should be added. Here too it works manually, but when reccorded in macro "it freezes the positions" and does not find the actual last line/cell in the table as the table grows. I am not more than superficially familiar with VBA so I am not able to write code directly by myself. I can imagine that some loops finding the borders af an area and the last row may be needed, but I hope it may be solved mainly by reccording macro. Please help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy a pivot table to another sheet in a macro | Excel Discussion (Misc queries) | |||
Activate an variable located workbook and copy 2 ranges? | Excel Programming | |||
Recording a macro to copy into a series of variable ranges | Excel Programming | |||
Counting variable ranges and auto-summing variable ranges | Excel Programming | |||
Copy variable ranges fron difernte shets | Excel Worksheet Functions |