View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default 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.