Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default macro- keep value in cell and add value for adjacent cell

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macro- keep value in cell and add value for adjacent cell

In column C2 type

=a2 - b2

Then drag it down the entire column for as many rows as you have data in
columns A and B. To drag it down, select the cell with the formula in column
C and put the mounse pointer on the node at the lower right corner of the
selection outline until it forms a plus sign. Press and hold the left mouse
button and drag down. It will copy your formula and assign the appropriate
row numbers as it does so.

"kgallo" wrote:

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default macro- keep value in cell and add value for adjacent cell

But I don't want the cell address in column C. I want the actual formulas in
column A and column B. I just want to concatenate them.
ie: not a2-b2, but instead ((562*12)-100).
Do you know how to do that?
thanks.

"JLGWhiz" wrote:

In column C2 type

=a2 - b2

Then drag it down the entire column for as many rows as you have data in
columns A and B. To drag it down, select the cell with the formula in column
C and put the mounse pointer on the node at the lower right corner of the
selection outline until it forms a plus sign. Press and hold the left mouse
button and drag down. It will copy your formula and assign the appropriate
row numbers as it does so.

"kgallo" wrote:

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default macro- keep value in cell and add value for adjacent cell

This is what you want in every cell in column C ???
((562*12)-100).

"kgallo" wrote:

But I don't want the cell address in column C. I want the actual formulas in
column A and column B. I just want to concatenate them.
ie: not a2-b2, but instead ((562*12)-100).
Do you know how to do that?
thanks.

"JLGWhiz" wrote:

In column C2 type

=a2 - b2

Then drag it down the entire column for as many rows as you have data in
columns A and B. To drag it down, select the cell with the formula in column
C and put the mounse pointer on the node at the lower right corner of the
selection outline until it forms a plus sign. Press and hold the left mouse
button and drag down. It will copy your formula and assign the appropriate
row numbers as it does so.

"kgallo" wrote:

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default macro- keep value in cell and add value for adjacent cell

No, but yes. So for example:
A B C
1 =(564*12) =216 =((564*12)-216)
2 =(200*4) =45 =((200*4)-45)
3 =(568*48) =58 =((568*48)-58)

I have hundreds of row of the above (not the same numbers - all different).
Do you know how to write a macro to do this?
Thanks!


"Mike" wrote:

This is what you want in every cell in column C ???
((562*12)-100).

"kgallo" wrote:

But I don't want the cell address in column C. I want the actual formulas in
column A and column B. I just want to concatenate them.
ie: not a2-b2, but instead ((562*12)-100).
Do you know how to do that?
thanks.

"JLGWhiz" wrote:

In column C2 type

=a2 - b2

Then drag it down the entire column for as many rows as you have data in
columns A and B. To drag it down, select the cell with the formula in column
C and put the mounse pointer on the node at the lower right corner of the
selection outline until it forms a plus sign. Press and hold the left mouse
button and drag down. It will copy your formula and assign the appropriate
row numbers as it does so.

"kgallo" wrote:

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default macro- keep value in cell and add value for adjacent cell

So copy the formula in column A and - the value in column B

"kgallo" wrote:

No, but yes. So for example:
A B C
1 =(564*12) =216 =((564*12)-216)
2 =(200*4) =45 =((200*4)-45)
3 =(568*48) =58 =((568*48)-58)

I have hundreds of row of the above (not the same numbers - all different).
Do you know how to write a macro to do this?
Thanks!


"Mike" wrote:

This is what you want in every cell in column C ???
((562*12)-100).

"kgallo" wrote:

But I don't want the cell address in column C. I want the actual formulas in
column A and column B. I just want to concatenate them.
ie: not a2-b2, but instead ((562*12)-100).
Do you know how to do that?
thanks.

"JLGWhiz" wrote:

In column C2 type

=a2 - b2

Then drag it down the entire column for as many rows as you have data in
columns A and B. To drag it down, select the cell with the formula in column
C and put the mounse pointer on the node at the lower right corner of the
selection outline until it forms a plus sign. Press and hold the left mouse
button and drag down. It will copy your formula and assign the appropriate
row numbers as it does so.

"kgallo" wrote:

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macro- keep value in cell and add value for adjacent cell

What I see is that you are subtracting the value in column b from the product
of the formula in column a. That is what the formula in column C does by
your illustration below. That is if you try to concatenate the values of the
two columns, you will have to change the data types to string, then you could
use

=CONCATNATE(a2, b2)

in cell C2 then copy down. That would yield =(564*12)=216

and I don't believe that is what you want. What I originally gave you does
what the formula that you show for column C does, it just does not display
the formula in that format. It does give the same resulting value in column
C.

"kgallo" wrote:

No, but yes. So for example:
A B C
1 =(564*12) =216 =((564*12)-216)
2 =(200*4) =45 =((200*4)-45)
3 =(568*48) =58 =((568*48)-58)

I have hundreds of row of the above (not the same numbers - all different).
Do you know how to write a macro to do this?
Thanks!


"Mike" wrote:

This is what you want in every cell in column C ???
((562*12)-100).

"kgallo" wrote:

But I don't want the cell address in column C. I want the actual formulas in
column A and column B. I just want to concatenate them.
ie: not a2-b2, but instead ((562*12)-100).
Do you know how to do that?
thanks.

"JLGWhiz" wrote:

In column C2 type

=a2 - b2

Then drag it down the entire column for as many rows as you have data in
columns A and B. To drag it down, select the cell with the formula in column
C and put the mounse pointer on the node at the lower right corner of the
selection outline until it forms a plus sign. Press and hold the left mouse
button and drag down. It will copy your formula and assign the appropriate
row numbers as it does so.

"kgallo" wrote:

I am trying to write a simple macro to an essence do the following:
A B C
1 =(564*12) =216 =((564*12)-216)
2
3

I want a macro to do column C. I have hundreds of rows where I need this and
would rather not type them all out.
Any help would be much appreciated!
Thanks.

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
Force entry into cell, based on validation selection in adjacent cell Richhall[_2_] Excel Worksheet Functions 3 June 18th 09 10:28 AM
How to populate a cell with numeric value based on textselected from pull down in adjacent cell? Garth Rodericks Excel Worksheet Functions 1 September 5th 08 02:03 AM
Run Macro from cell change THEN select adjacent cell mslabbe Excel Programming 4 December 24th 06 06:49 PM
Inputting cell value from source cell based on value in adjacent cell. michaelberrier Excel Discussion (Misc queries) 3 December 9th 06 09:16 PM
change current cell colour based on the value of adjacent cell on other worksheet Rits Excel Programming 2 November 23rd 06 11:57 AM


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