Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to know how to code macro to select range of columns and compare the value of each cell.Here is an example of the file. I want to check TCIT column and if the value is "Y" copy the row to a seperate Sheet. 1 4 TCIT Y/N 3 4 5 6 Maint or Proj 4 r N N/A N ??? Test 2 ??? Y P N t Test 4 r N N/A N ??? Test Thanks for help Vedula |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub CopyRow()
Dim myCell As Range Dim mySheet1 As Worksheet Dim mySheet2 As Worksheet Set mySheet1 = Worksheets(InputBox("Enter name of input sheet")) Set mySheet2 = Worksheets(InputBox("Enter name of output sheet")) mySheet1.Activate Range("A1").CurrentRegion.Select Selection.Offset(0, 2).Resize(, 1).Select For Each myCell In Selection If UCase(myCell.Value) = "Y" Then myCell.EntireRow.Copy mySheet2.Activate Range("A1").CurrentRegion.Select Selection.Offset(Selection.Rows.Count).Resize(1, 1).Select ActiveSheet.Paste End If Next myCell End Sub Good luck! " wrote: Hi, I would like to know how to code macro to select range of columns and compare the value of each cell.Here is an example of the file. I want to check TCIT column and if the value is "Y" copy the row to a seperate Sheet. 1 4 TCIT Y/N 3 4 5 6 Maint or Proj 4 r N N/A N ??? Test 2 ??? Y P N t Test 4 r N N/A N ??? Test Thanks for help Vedula |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help needed | Excel Discussion (Misc queries) | |||
Deleting Rows With Non-Needed Data between Needed Data | Excel Worksheet Functions | |||
Look Up Help Needed Again | Excel Discussion (Misc queries) | |||
Look Up Help Needed | Excel Discussion (Misc queries) | |||
Help Needed - Please | Excel Discussion (Misc queries) |