Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was given this snippet to scan a range for a unique text and then capture
the cell value. This has worked great. Now I would like to also capture the cell value of the unique text string and the cell value of the next cell. These values would be put into Worksheet 2 columns A & B. I am just not sure how to move the cell capture. Sub copyData() Dim cell As Range, rw As Long rw = 2 For Each cell In ActiveSheet.Range("A1:i9306") 'Range of InDesign file If InStr(1, cell, "CRG", vbTextCompare) Then 'Unique string Worksheets("Sheet2").Cells(rw, 1).Value = cell.Value rw = rw + 1 End If Next End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try adding the following code just below (Worksheets("Sheet2").Cells(rw,
1).Value = cell.Value). Worksheets("Sheet2").Cells(rw, 2).Value = cell.offset(0,1).Value HTH, Paul "Pablo" wrote in message ... I was given this snippet to scan a range for a unique text and then capture the cell value. This has worked great. Now I would like to also capture the cell value of the unique text string and the cell value of the next cell. These values would be put into Worksheet 2 columns A & B. I am just not sure how to move the cell capture. Sub copyData() Dim cell As Range, rw As Long rw = 2 For Each cell In ActiveSheet.Range("A1:i9306") 'Range of InDesign file If InStr(1, cell, "CRG", vbTextCompare) Then 'Unique string Worksheets("Sheet2").Cells(rw, 1).Value = cell.Value rw = rw + 1 End If Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking sheet for values and capturing column name | Excel Programming | |||
Capturing a series of calculated values to analyse Real-Time Data | Excel Programming | |||
Capturing First Change In A Cell | Excel Worksheet Functions | |||
Capturing Maximum and Minimum values | Excel Programming | |||
Capturing Decimal Values in Variable - Losing decimals when summin | Excel Programming |