Related:
- To compare and return the string value
- "Compare versions word" - Guide
- Beyond compare download - Download - File management
- Thunderbird return receipt - Guide
- Vba case string - Guide
- Compare and count - Office Software Forum
6 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 24, 2009 at 09:20 PM
Aug 24, 2009 at 09:20 PM
quote
eturn the value "Apple A 1245" into a cell......"
unquote
in which cell?
eturn the value "Apple A 1245" into a cell......"
unquote
in which cell?
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 25, 2009 at 05:27 AM
Aug 25, 2009 at 05:27 AM
still I am confused . pl gives the first few rows of sheet 2
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 26, 2009 at 09:54 PM
Aug 26, 2009 at 09:54 PM
still nto clear
I am rephrasing it
fruit names are there in A2 down in column A in sheet 1
if the length of the furit name is 12 OR 15 that row in sheet should be copied
to the first blank row in sheet 2.
(what happens if it is 1 to 11,13 ,14,16 and above nothing is to be done )
if this is ok
try this macro
I am rephrasing it
fruit names are there in A2 down in column A in sheet 1
if the length of the furit name is 12 OR 15 that row in sheet should be copied
to the first blank row in sheet 2.
(what happens if it is 1 to 11,13 ,14,16 and above nothing is to be done )
if this is ok
try this macro
Sub test()
Dim rng As Range, c As Range
With Worksheets("sheet1")
Set rng = Range(.Range("a2"), .Range("A2").End(xlDown))
For Each c In rng
If Len(c) = 12 Or Len(c) = 15 Then
c.EntireRow.Copy
End If
With Worksheets("sheet2")
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
End With
Next c
End With
End Sub
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 27, 2009 at 05:39 AM
Aug 27, 2009 at 05:39 AM
if you have only lenghts of 12 and 15 why not just copy the whole sheet.
of do you want elngth 12 in one sheet (sheet 2) and 15 in another sheet sheet 3.
of do you want elngth 12 in one sheet (sheet 2) and 15 in another sheet sheet 3.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 27, 2009 at 08:53 PM
Aug 27, 2009 at 08:53 PM
it is not that simple. the macro is modified. the modifie macro is given below
Sub tes1()
Dim rng As Range, c As Range
With Worksheets("sheet1")
Set rng = Range(.Range("A2"), .Range("A2").End(xlDown))
For Each c In rng
If Len(c) = 12 Then
c.EntireRow.Copy
With Worksheets("sheet2")
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
End With
ElseIf Len(c) = 15 Then
c.EntireRow.Copy
With Worksheets("sheet3")
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
End With
End If
Next c
End With
End Sub
Aug 24, 2009 at 10:18 PM
thanks