LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Conditionally copy cell from one column to another VBA

Don Guillett Excel MVP wrote in
:

On Jan 23, 7:39*am, Isis wrote:
I want to loop through a column row by row, (at least I think I need
to loop ?)and then conditionally copy the value of that cell to a
different column (but the same row) after a mathmatical operation
(times -1, or plu

s
.3 etc) on the value.

How would I do that ?

Can I adapt it so that the column can be 'set' when running ?

Thanks for any input


Hard to tell without seeing as your explanation is lacking
"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."


Thanks for the reply Don.

What I want to do is something like this;

Col1 Col2
1
2
3
4

Sheet as above - I want to run some code and end up with;

Col1 Col2
1 Untouched
-2 x * -1
-3 x * -1
4 Untouched


I dont mind too much if the values are also left in the first column but I
want the results placed in the empty cells of Col2.

Imagine, if you would - I have a load of sheets of data that contain 3
columns - 'payments IN' , 'payments Out' and a 'Balance' column.

All the figures in 'payments In' and 'payments Out' are positive decimal
amounts - I want to end up with just 2 columns, one containing positive
decimals from 'payments IN' and also negative decimals from 'payments Out'
and a 'Balance' column where I will show a running balance.

Hope this makes sense;

So in pseudo code;

Loop i# = B1 to B? 'Loop through every filled B cell
If cell.Value 'If the is a value in this cell
Ci# = (cell.Value * -1) 'Copy over to C Column (same Row) - negative
End If
End Loop


Hope that makes sense

Thanks
 
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
summing across worksheets conditionally and being able to copy for Celia Excel Discussion (Misc queries) 4 March 19th 10 06:37 AM
How do I conditionally format a row and copy the formatting to tab nandu1256 Excel Worksheet Functions 1 March 5th 10 04:15 AM
How can I have Excel conditionally copy a cell CA_stateworker Excel Worksheet Functions 2 September 10th 09 06:23 PM
Copy text cell & change text color conditionally manxman Excel Programming 2 August 31st 06 08:18 PM
copy rows conditionally J_J[_2_] Excel Programming 2 March 28th 05 06:45 AM


All times are GMT +1. The time now is 08:21 AM.

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"