Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Parsing blocks of cells using VBA

Hello,

I have a large amount of bibliographic data (ca. 1000 rows and 5 or 6
columns) in csv format saved in Excel tables. After filtering out what I
need I want to save the filtered data for archiving, say 20-30 rows at a
time. I parse text from column 1 and then from column 5 or 6 and then I want
to save it as a record.

In other words in pidgin pseudocode

For all the rows selected
get some stuff from column 1 and then move to column 5 or 6 depending on
whether a certain value is in one of them
then move to next row down
carry on until all rows have been processed

Having looked at several books I am completely bamboozled about what to use:
range, offset.

Can anyone give me a start?

Many thanks,

Gordon Filby


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Parsing blocks of cells using VBA

Try something like this on a COPY Of your workbook

dim myRange as range
dim r as range

lrow = cells(rows.count,1).end(xlup).row
set myRange = cells(1,1).resize(lrow,1)

for each r in myrange
'Get some stuff
Value = r.value 'I'm not sure what you are doing here, so will leave it to
you.
'Move to Column 5 or 6

If condition then
Cells(r.row,5)value = Vlue
else
Cells(r.row,6).value = value
end if
next r
"Gordon Filby" wrote:

Hello,

I have a large amount of bibliographic data (ca. 1000 rows and 5 or 6
columns) in csv format saved in Excel tables. After filtering out what I
need I want to save the filtered data for archiving, say 20-30 rows at a
time. I parse text from column 1 and then from column 5 or 6 and then I want
to save it as a record.

In other words in pidgin pseudocode

For all the rows selected
get some stuff from column 1 and then move to column 5 or 6 depending on
whether a certain value is in one of them
then move to next row down
carry on until all rows have been processed

Having looked at several books I am completely bamboozled about what to use:
range, offset.

Can anyone give me a start?

Many thanks,

Gordon Filby



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Parsing blocks of cells using VBA

Hallo,

Looks to be exactly what I need. I didn't know about resize. Easy when you
know how. I'll try it on the copy and let you know.

Thanks for the very prompt response.

Best Regards,

Gordon Filby


"Barb Reinhardt" schrieb im
Newsbeitrag ...
Try something like this on a COPY Of your workbook

dim myRange as range
dim r as range

lrow = cells(rows.count,1).end(xlup).row
set myRange = cells(1,1).resize(lrow,1)

for each r in myrange
'Get some stuff
Value = r.value 'I'm not sure what you are doing here, so will leave it to
you.
'Move to Column 5 or 6

If condition then
Cells(r.row,5)value = Vlue
else
Cells(r.row,6).value = value
end if
next r
"Gordon Filby" wrote:

Hello,

I have a large amount of bibliographic data (ca. 1000 rows and 5 or 6
columns) in csv format saved in Excel tables. After filtering out what I
need I want to save the filtered data for archiving, say 20-30 rows at a
time. I parse text from column 1 and then from column 5 or 6 and then I
want
to save it as a record.

In other words in pidgin pseudocode

For all the rows selected
get some stuff from column 1 and then move to column 5 or 6 depending
on
whether a certain value is in one of them
then move to next row down
carry on until all rows have been processed

Having looked at several books I am completely bamboozled about what to
use:
range, offset.

Can anyone give me a start?

Many thanks,

Gordon Filby





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
Copying Blocks of Cells [email protected] Excel Discussion (Misc queries) 1 March 4th 09 11:54 AM
macro needed to copy blocks of cells across to list of cells down piersonpro Excel Programming 3 March 28th 07 12:51 PM
Compare blocks of cells Rominall Excel Programming 1 March 9th 07 03:20 PM
Transposing blocks of cells Dave Excel Programming 0 March 23rd 06 03:58 PM
parsing blocks of cells for charts [email protected] Excel Programming 2 February 26th 06 05:53 PM


All times are GMT +1. The time now is 03:40 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"