Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Capturing Cell Values

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Capturing Cell Values

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking sheet for values and capturing column name Complete Newb Excel Programming 9 February 3rd 07 10:08 PM
Capturing a series of calculated values to analyse Real-Time Data Gavin Marcus Excel Programming 3 October 4th 06 04:12 PM
Capturing First Change In A Cell carl Excel Worksheet Functions 4 February 21st 06 01:21 PM
Capturing Maximum and Minimum values tx12345[_3_] Excel Programming 1 December 6th 05 04:15 AM
Capturing Decimal Values in Variable - Losing decimals when summin Mark Excel Programming 1 September 14th 05 05:26 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"