vba - split a value into two different variable -
I thought I had a problem, but now I have to face another problem ... VBA It is very difficult. Last code for j = 2 for the last line for <= P>
i = 2 LastCol '' * contains a lot of code in it ... * 'salk = sheets ("Sheets"). Room (i, j). Well Appearance = Worksheet Function. Select the case appearance (1 "D1 9") in the county (Range ("B1: D9"), Sawd arrOutput (2) Case 1 Sheets ("Sheetx"). Room (i, j). Value = salk & amp; "(2) ArrOutput (1) = GroupCol (salk) - arrOutput (0) arrOutput (2) =" 0 sheet ("SheetX"). Room (i, j). Value = salk & amp; "(& amp; arr.; ArrOutput (0) & amp;" - "& arrOutput (1) & amp;") "Case Other messagebox "error" end Select Next Next Next
The above code I have been able to get this result:
I am very satisfied with that code, which is an odd number two different Divides into numbers so I do not have to cut the half of the people when there is also a also number as a result in a group, it can be divided into two equal numbers when its one Strange Number then it becomes very difficult How did Dave help me to fix strange numbers? I have implemented Dave's code in my code. You see that the total number of people in a group related to a team is the total number of persons. You can see that 4 A4 has a total of 39. Because this group shows twice, I want to divide this group into two. When I do this, I get 18.5, Dave's code (applied above) gives me the ability to get the following two numbers I and 20. I am asking that these two different groups should be grouped together Together with group group, see 19 (see B2 in the picture) and the second number goes to 20 B6. When it is adjusted I get the following image:
Because the selection case is in a loop, I can not reserve them in a different variable: (... what do I want.
I have a possible solution (I took some time and the quality of the alga is not good)
Instead:
In Case 2
(You have to adopt your code, I have seen it on a personal example):
'====== Elgo start' calculates the number of the following cells before the current cell Select the case depends on the ROWS because you can not use the category that is not consistent with COUNTIF! Case 1 Appearance = Worksheet Function. Flag (range ("b1" and p; ":" & Amp; Room (I, J). Adapter), sql) Case 2 attendor = worksheet function. (Range "B2" and ":" and (cells (i, j) address), salk) _ + worksheet function. Range ("B1: D1"), SALK) Case 3 attendant = worksheet function . Contraag (Range ("B3" and ":" and cells (I, J). Address), Salk) _ Worksheet Function. ("B1: D2"), SALK) Case 5 'etc. ...' All Other Cases Appearance of Case 1 Appearance = Worksheet Function. Contraag (range ("B19" and ":" and (cells (i, j).), Salk) _ + WorksheetFunction.CountIf (Range ("B1: D18", SQL) should not be the case "Error, out of range" and select select curr = appearance cruel - 1 'zero 1 because the current cell will count' ===== Algo and Sheets ("SheetX"). Cells (i, j) Value = SAC & Amp; "I think that " B1: D19 "
I'm not completely sure that it's going to work, code > Your Nested Lu With the p (in case of category) it is connected.
As already mentioned, you probably have to optimize this code. What is important is this idea: I know that from the current cell How often the first time was found and (this would be 0 or 1 in your example) and associate with the position in your array (:
Note: This one The above and the dirty code, I can be clearly customized (like using loop instead of
select case
for )
Anyway , I hope this will help you and you can use it to use it
Comments
Post a Comment