excel vba - In range find this and do that -


There is a limit of cells with columns heading, in the range of cells, I want to find a number , Say

1 if it finds 1, then look for a variable, 2 or 4 in a row in the row, now that I can "triangle" (cell copy and paste) 1 "Then leave the number of variables in the week and add another triangle and continue doing it till the end of the range, then to the next line Put it down and do it by the end of the border, do the same way. Then, change to the next page and do the same thing ... through the entire workbook.

I think I have done this, know It is not the best way to do that.

I get an error 91 at the end of the second loop, second time the second loop ends, it goes through the error code. The error is over.

I do not know Is run through a bar, but not twice. sub add_translation2 () Dim Rng as the range dim range ("G25") 'Range worksheets (1) in the second Used to prevent the loop. Activate worksheets (1) range ("A1"). Select 'Paste the item (a triangle) to select. Copy for each of the worksheets worksheets (ws.Name). Active with range ("C4: G25") set RNG =. 1, Look In: ​​= XLVL) If not, then RGG is not something first then address = RNG. Contact RNG Activate Active Activate Paste OffRemember = Range ("A" and Activisel.ro) OffsetRange Set = Range Offset (0, -Enfnumber) if not ActiveCell.Address & lt; OffsetRange.Address and then exit if ActiveCell.Offset (, OffNumber). Select ActiveSheet.Paste Loop (ActiveCell.Address & lt; = OffsetRange.Address) Set the error on the Goto error line RNG = .Fund-next (RNG) loop while Rng is not nothing and RNG. Address & lt; & Gt; FirstAddress End if the error ends with: Error on the GoTo 0 application. EnabledEvents = True Next ws Application.CutCopyMode = False End Sub

I created from your description Using the Data Set was not able to receive error 91, perhaps a screenshot of the layout could help to recreate the problem.

However, I will do something like this, it will see the value of each cell in the range C4: G25, and if it is equal to 1, then it will paste the stored symbol in cell A1. sub-add_Triangles2 () Dim Rng range as RangeSpeed ​​RangeSymbol RangeSimbol = Range ("A1") set as the intensity dim form worksheet set as intFindNum To paste the symbol of the variable, intFindNum = 1 'is used to keep numbers to find worksheets (1). Activate for each task that works in worksheets (ws.Name). Activate in range for each RNG ("C4: G25") if Rng.Value = intFindNum then rngSymbol.Copy RNG end if next RNG next cm end sub

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -