Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default copy cells down

how can i create a loop macro that look for a data in a specific column, lets
say column B, select that cell, select 3 cells to the right, cut these
selection and move one row down. Continue the same procedure until there is
no more cells containing the data. Thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default copy cells down

Hi
This will search from bottom to top to any cell containg "ABC"

Sub test
Dim x As Integer
For x = Range("B2", Range("B2").End(xlDown)).Rows.Count - 1 To 1 Step -1
If Range("B2").Offset(x, 0) = "ABC" Then
Range("B2").Offset(x, 0).Resize(1, 4).Cut Range("B2").Offset(x + 1, 0)
End If
Next x
End sub
Regards
Jean-Yves


"andresg1975" wrote in message
...
how can i create a loop macro that look for a data in a specific column,
lets
say column B, select that cell, select 3 cells to the right, cut these
selection and move one row down. Continue the same procedure until there
is
no more cells containing the data. Thanks for your help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default copy cells down



"Jean-Yves" wrote:

Hi
This will search from bottom to top to any cell containg "ABC"

Sub test
Dim x As Integer
For x = Range("B2", Range("B2").End(xlDown)).Rows.Count - 1 To 1 Step -1
If Range("B2").Offset(x, 0) = "ABC" Then
Range("B2").Offset(x, 0).Resize(1, 4).Cut Range("B2").Offset(x + 1, 0)
End If
Next x
End sub
Regards
Jean-Yves


"andresg1975" wrote in message
...
how can i create a loop macro that look for a data in a specific column,
lets
say column B, select that cell, select 3 cells to the right, cut these
selection and move one row down. Continue the same procedure until there
is
no more cells containing the data. Thanks for your help



i change ABC to 3020 and does not work, am i doing something wrong

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default copy cells down

let's say i have rows like these:
B C D E
3020 0 28TH 28TH ST. MARKETPLACE

3020 0 ACME ACME AWNING

The macro should find 3020, take cells in colums B C D E and bring them one
row down



"Jean-Yves" wrote:

Hi
This will search from bottom to top to any cell containg "ABC"

Sub test
Dim x As Integer
For x = Range("B2", Range("B2").End(xlDown)).Rows.Count - 1 To 1 Step -1
If Range("B2").Offset(x, 0) = "ABC" Then
Range("B2").Offset(x, 0).Resize(1, 4).Cut Range("B2").Offset(x + 1, 0)
End If
Next x
End sub
Regards
Jean-Yves


"andresg1975" wrote in message
...
how can i create a loop macro that look for a data in a specific column,
lets
say column B, select that cell, select 3 cells to the right, cut these
selection and move one row down. Continue the same procedure until there
is
no more cells containing the data. Thanks for your help




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default copy cells down

Sub test
Dim x As Integer
For x = Range("B2", Range("B2").End(xlDown)).Rows.Count - 1 To 1 Step -1
If Range("B2").Offset(x, 0).value = "3020" Then
Range("B2").Offset(x, 0).Resize(1, 4).Cut Range("B2").Offset(x + 1, 0)
End If
Next x
End sub
Regards
Jean-Yves


"andresg1975" wrote in message
...
let's say i have rows like these:
B C D E
3020 0 28TH 28TH ST. MARKETPLACE

3020 0 ACME ACME AWNING

The macro should find 3020, take cells in colums B C D E and bring them
one
row down



"Jean-Yves" wrote:

Hi
This will search from bottom to top to any cell containg "ABC"

Sub test
Dim x As Integer
For x = Range("B2", Range("B2").End(xlDown)).Rows.Count - 1 To 1 Step -1
If Range("B2").Offset(x, 0) = "ABC" Then
Range("B2").Offset(x, 0).Resize(1, 4).Cut Range("B2").Offset(x + 1,
0)
End If
Next x
End sub
Regards
Jean-Yves


"andresg1975" wrote in message
...
how can i create a loop macro that look for a data in a specific
column,
lets
say column B, select that cell, select 3 cells to the right, cut these
selection and move one row down. Continue the same procedure until
there
is
no more cells containing the data. Thanks for your help






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
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy Source Cells to Destination Cells Only when a Change Occurs excel student Excel Discussion (Misc queries) 2 July 13th 08 04:13 AM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


All times are GMT +1. The time now is 03:19 AM.

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

About Us

"It's about Microsoft Excel"