View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Zakynthos Zakynthos is offline
external usenet poster
 
Posts: 115
Default Using Find/Replace in Visual basic to adapt the code

Bernie,

Many thanks!! You've solved my problem.

Regards

Tony

"Bernie Deitrick" wrote:

Zakynthos,

Use find/replace to replace

").Select

with

").Resize(2).Select

That will change all your select statements to select 2 rows.

HTH,
Bernie
MS Excel MVP


"Zakynthos" wrote in message
...
'Ron,

Sorry, I didn't explain myself very well!!!!

I have a lot of data to process and 'recording' each macro I need to extract
data will be very time consuming, so I'm looking for as many shortcuts as I
can find!

Given that I have recorded a macro to delete ONE whole row (say, columns
a:h) in every 60 or so rows and I now want a macro (without having to go
through the long process of 'recording' it!) to delete TWO consecutive rows
in every 60 rows, how can I get a 'quick fix' (FInd/Replace???, but how???)
to replace ALL instances of a1:h1, a66-h66 etc with a1:h2, a66-h67 etc etc



"Ron de Bruin" wrote:

If I understand you correct
You can use this

Range("A3:H3,A66:H66").Select

But you don't have to select

Range("A3:H3,A66:H66").EntireRow.Delete


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Zakynthos" wrote in message
...


Is there are way of using either Find/Replace or some othe procedure within
Visual Basic to make global changes to a pattern of cells to be selected.

For example, if I wanted to select and delete 2 rows in a block, using say

Range ("A3:H3").Select and Range ("A66:H66").Select

then wanted to create another procedure which would select:

Range ("A3:H4").Select and Range ("A66:H67").Select etc etc

How would I do this?