Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default moving contents of cells based on criteria


Hope someone can help with this question:

I have a range of cells between A10:B16.

Based on the information in B10 to B16 (ie in column B) I want a macr
to take the values and drop them into cells A4 to A9 respectively

For example: If b10 does not contain "(A1)" then the value of B10 i
dumped into A5. If B11 does not contain "(A1)" then the value of B1
is dumped into A6 etc.


Is this possible using a loop of some sort ?

Many thanks for your help.

Scot

--
scottwilson
-----------------------------------------------------------------------
scottwilsonx's Profile: http://www.excelforum.com/member.php...fo&userid=1112
View this thread: http://www.excelforum.com/showthread.php?threadid=27774

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default moving contents of cells based on criteria

Scott,

Sub TryNow()
Dim myCell As Range
Dim i As Integer

Range("A4:A9").ClearContents

i = 1
For Each myCell In Range("B10:B16")
If Not InStr(myCell.Value, "(A1)") 0 Then
Range("A4")(i, 1).Value = myCell.Value
i = i + 1
End If
Next myCell
End Sub

HTH,
Bernie
MS Excel MVP

"scottwilsonx" wrote in message
...

Hope someone can help with this question:

I have a range of cells between A10:B16.

Based on the information in B10 to B16 (ie in column B) I want a macro
to take the values and drop them into cells A4 to A9 respectively

For example: If b10 does not contain "(A1)" then the value of B10 is
dumped into A5. If B11 does not contain "(A1)" then the value of B11
is dumped into A6 etc.


Is this possible using a loop of some sort ?

Many thanks for your help.

Scott


--
scottwilsonx
------------------------------------------------------------------------
scottwilsonx's Profile:

http://www.excelforum.com/member.php...o&userid=11128
View this thread: http://www.excelforum.com/showthread...hreadid=277742



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
Display contents of cell based on criteria Carlee Excel Worksheet Functions 2 October 12th 07 02:28 PM
Moving cells based on certain criteria halvy52 Excel Discussion (Misc queries) 5 April 28th 07 04:01 AM
Finding cell contents based on certain criteria thekovinc Excel Discussion (Misc queries) 1 March 15th 06 07:37 PM
Finding cell contents based on certain criteria thekovinc Excel Discussion (Misc queries) 1 March 15th 06 07:20 PM
moving rows based on criteria Phillips Excel Programming 3 December 10th 03 10:17 AM


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