View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Robert Robert is offline
external usenet poster
 
Posts: 113
Default Copy marked records from Workbook to Workbook

Tom, I saw your last post only just now. I had in the meantime thru trial and
error (taking about 3 hours) got the code working exactly as I wanted. Made
the followng
changes.

Do While Not IsEmpty(Cells(RowR, "D"))

Application.Workbooks("AUpate.xls").Worksheets(1). Activate
i = 1 ' column B
Cells(RowU, i) = Var1
Cells(RowU, i + 1) = Var2
Cells(RowU, i + 2) = Var3
Cells(RowU, i + 3) = Var4 'was 5 OK
Cells(RowU, i + 4) = Var6 'was 7 OK
Cells(RowU, i + 5) = Var8
Cells(RowU, i + 6) = Var9
Cells(RowU, i + 7) = Var10
Cells(RowU, i + 8) = Var11 'was 12 OK
Cells(RowU, i + 9) = Var12
Cells(RowU, i + 10) = Var15 'Was 14 OK
Cells(RowU, i + 11) = Var16 'Was 15 ok
Cells(RowU, i + 12) = Var17 'Was 16 ok
Cells(RowU, i + 13) = Var18 'Was 17 ok
Cells(RowU, i + 14) = Var24

As I said before, YOU put me on the right track. Tk u again.
--
Robert


"Tom Ogilvy" wrote:

Let's try it in the immediate window and see:

rowU = 10
i = 2 ' column B
? Cells(RowU, i).address
$B$10

looks like column B to me. Maybe you didn't plant the code properly.

--
Regards,
Tom Ogilvy

"Robert" wrote:

Thank you Tom. I planted your code. Yes it reads from col b but writes to
col c
(instead col b). It does not do the rest. I shall figure it out over time.
You have put me in the right direction.
--
Robert