View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
JS SL JS SL is offline
external usenet poster
 
Posts: 49
Default Count the sum of multiply values in one cell, registered as partof a textcode, combine them per column and show the results in the next sheet

Thanks Claus.
Now it's clear when inserting in Sheet2 a column resulting in moving the TextCodes to another column, but..... Now I'm strugling with understanding the startpoint in Sheet1.

In one of the first codes it was;
For i = LBound(varNames, 2) To UBound(varNames, 2)
z = i + 10
So, because I inserted also some columns in Sheet1 it was easy understanding to change i+10 to i+26 because I change the startingpoint to column AA.

You have change this part of the code to
LColSh1 = .Cells(5, .Columns.Count).End(xlToLeft).Column
varNames = .Range(.Cells(5, firstSh1), .Cells(5, LColSh1))

So I thought I have to change it to
LColSh1 = .Cells(27, .Columns.Count).End(xlToLeft).Column
varNames = .Range(.Cells(5, firstSh1), .Cells(27, LColSh1))

Oeps..... didn't work. In the normal situation and even when I had change it it gave the error on code record;
iNmbr = Left(Split(rngC, "[")(1), Len(Split(rngC, "[")(1)) - 1)

I need the helpdesk (again).

In fact;
Sheet1 headings are in row 5, a general always filled column is A, the columns with the textcodes starts in column AA end will be end at max in the future 100 columns further
Sheet2 headings are in row 1, a general always filled column is A, the columns with the counting of the textcodes from sheet1 starts in column H (and ended with data in the furture at max H+100).

HELP :)
Perhaps its easy to solve, but... I can't see the trick (early in the morning).

regards, Johan