Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I got this macro that all the letters "K" that are printed in row B, send to
sheet2 by order all the line of that letter starting in row B. What i want is to limit the rows that are copy to sheet2, cos in Macro in sheet1 i copy all the rows after row "C", to sheet2, but i want to limit the copy since "C" to row "G", can anyone help me? Thanks Sub comlin4() Dim i As Long Dim nextrow As Long With ActiveSheet For i = 2 To .Cells(.Rows.Count, "B").End(xlUp).Row If .Cells(i, "B").Value = "K" Then With Worksheets("Folha2") nextrow = .Cells(.Rows.Count, "B").End(xlUp).Row + 1 End With .Cells(i, "C").Resize(, 10).Copy Worksheets("Folha2").Range("B" & nextrow) End If Next i End With End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Micos,
Change Resize(, 10) to Resize(, 5) HTH, Bernie MS Excel MVP "Micos3" wrote in message ... I got this macro that all the letters "K" that are printed in row B, send to sheet2 by order all the line of that letter starting in row B. What i want is to limit the rows that are copy to sheet2, cos in Macro in sheet1 i copy all the rows after row "C", to sheet2, but i want to limit the copy since "C" to row "G", can anyone help me? Thanks Sub comlin4() Dim i As Long Dim nextrow As Long With ActiveSheet For i = 2 To .Cells(.Rows.Count, "B").End(xlUp).Row If .Cells(i, "B").Value = "K" Then With Worksheets("Folha2") nextrow = .Cells(.Rows.Count, "B").End(xlUp).Row + 1 End With .Cells(i, "C").Resize(, 10).Copy Worksheets("Folha2").Range("B" & nextrow) End If Next i End With End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I tryed before to change that number in resize, but once i didn't knew what
could i do, i change and it didn't gave the same result, but now worked just fine, and now i can see the light. :D Many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help In Excel | Excel Discussion (Misc queries) | |||
deleting a macro resulted in a problem | Excel Discussion (Misc queries) | |||
External data Macro Problem Excel 97 | Excel Discussion (Misc queries) | |||
Problem executing a macro from different workbook where it is | Excel Discussion (Misc queries) | |||
macro problem | Excel Discussion (Misc queries) |