Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Pasteing values with conditions

I have a sheet that is setup as follows: Range links1 has some links in it,
not all of the rows have links, but a majority of them do. The cells with
links in them are colored red, other cells are filled with a couple other
colors. i need some code that will find a cell that is red in that range,
check if there is a value in it, and if there is a value and the cell is red,
copy that value and paste that value one cell to the right. I know there is
a way to do this, but i am not sure how to get the code going. I would
really appreciate any help as this will really speed up a process. Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Pasteing values with conditions

for each cell in range("links")
if cell.interior.colorIndex = 3 then
if cell.HasFormula then
cell.offset(0,1).Value = cell.value
end if
end if
next

it isn't clear what you are looking for when you say value - is value
synonymous with number? then instead of hasformula do

if isnumeric(cell.value) then
cell.offset(0,1).Value = cell.value

--
regards,
Tom Ogilvy


"brownti via OfficeKB.com" wrote:

I have a sheet that is setup as follows: Range links1 has some links in it,
not all of the rows have links, but a majority of them do. The cells with
links in them are colored red, other cells are filled with a couple other
colors. i need some code that will find a cell that is red in that range,
check if there is a value in it, and if there is a value and the cell is red,
copy that value and paste that value one cell to the right. I know there is
a way to do this, but i am not sure how to get the code going. I would
really appreciate any help as this will really speed up a process. Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Pasteing values with conditions

There are different shades of red, so 3 may not be the right number

Sub getcolor()

mycolor = ActiveCell.Interior.ColorIndex

MsgBox ("Active Cell Color = " & CStr(mycolor))

End Sub

"Tom Ogilvy" wrote:

for each cell in range("links")
if cell.interior.colorIndex = 3 then
if cell.HasFormula then
cell.offset(0,1).Value = cell.value
end if
end if
next

it isn't clear what you are looking for when you say value - is value
synonymous with number? then instead of hasformula do

if isnumeric(cell.value) then
cell.offset(0,1).Value = cell.value

--
regards,
Tom Ogilvy


"brownti via OfficeKB.com" wrote:

I have a sheet that is setup as follows: Range links1 has some links in it,
not all of the rows have links, but a majority of them do. The cells with
links in them are colored red, other cells are filled with a couple other
colors. i need some code that will find a cell that is red in that range,
check if there is a value in it, and if there is a value and the cell is red,
copy that value and paste that value one cell to the right. I know there is
a way to do this, but i am not sure how to get the code going. I would
really appreciate any help as this will really speed up a process. Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Pasteing values with conditions

I knew it would be something pretty simple, thanks.

Tom Ogilvy wrote:
for each cell in range("links")
if cell.interior.colorIndex = 3 then
if cell.HasFormula then
cell.offset(0,1).Value = cell.value
end if
end if
next

it isn't clear what you are looking for when you say value - is value
synonymous with number? then instead of hasformula do

if isnumeric(cell.value) then
cell.offset(0,1).Value = cell.value

I have a sheet that is setup as follows: Range links1 has some links in it,
not all of the rows have links, but a majority of them do. The cells with

[quoted text clipped - 4 lines]
a way to do this, but i am not sure how to get the code going. I would
really appreciate any help as this will really speed up a process. Thanks


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

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
Pivot table copy and pasteing kswan Excel Discussion (Misc queries) 2 October 17th 07 01:32 AM
Pasteing a list without duplicates Matthew Balch[_2_] Excel Programming 1 November 1st 06 11:35 AM
How do I use an activecell as coordinates for pasteing? wilro85[_8_] Excel Programming 1 December 14th 05 05:56 PM
How to calculate values in multiple values with multi conditions Curtis Excel Worksheet Functions 2 July 15th 05 02:36 AM
keep a cell used in a formula constant when pasteing into another. Rob Excel Worksheet Functions 1 January 26th 05 08:13 AM


All times are GMT +1. The time now is 07:26 PM.

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"