PC Review


Reply
Thread Tools Rate Thread

Capturing Cell Values

 
 
=?Utf-8?B?UGFibG8=?=
Guest
Posts: n/a
 
      7th Jun 2007
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 With Quote
 
 
 
 
PCLIVE
Guest
Posts: n/a
 
      7th Jun 2007
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" <(E-Mail Removed)> wrote in message
news:B3A62146-984D-438C-A4C4-(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing Global variable values Larry06Green Microsoft Access VBA Modules 0 13th May 2008 04:10 PM
Capturing Undo Values David Markfield Microsoft Excel Programming 0 21st Jan 2008 04:39 PM
Capturing DAP Query Values =?Utf-8?B?anN0cm91cA==?= Microsoft Access 5 19th Jan 2005 04:49 PM
Web: Capturing the current cell values on double-click event of a datagrid Tony Fields Microsoft ASP .NET 0 9th Dec 2004 04:09 PM
Capturing Parameter Values Josef Microsoft Access Form Coding 2 28th May 2004 04:42 AM


Features
 

Advertising
 

Newsgroups
 


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