Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Seemingly Easy Question...help would be greatly appreciated

I am currently starting learning how to program with VBA. I am able t
see how powerful a tool it can be. This is my problem. I currentl
create spreadsheets where I have to repeatedly enter a value in on
cell and subtract the three cells to the left of it. To state m
problem clearly, I am given the annual operating information for
company and need to "back out" each quarter's results. Therefore, whe
looking at an annual report, I only have the annual results for the 4t
quarter, not the observed amount. Therefore, to back out this value,
have to subtract the previous three quarters from it (three cells t
the left of it).

Ultimately, what I would like to do is type the "running annual total
in the appropriate Q4 cell, type a shortcut, and have it subtract th
values in the three cells to the left of it. However, to my limite
programming knowledge, I have been trying to use VBA to recognize th
value in the cell and then subtract it from the cells to the left
however, it is not functioning properly. If need be, I would even b
willing ot have a input box prompt me for the annual total to be use
in the formula.

Since I would be performing this action often, I believe this is
relative reference issue, and not an absolute cell reference.
Additionally, assuming that the code is relatively simple, I think
have enough knowledge (or at least be able to figure out) how to creat
another macro that lets me subtract only two columns to the left, the
only one column to the left.

I apologize for the long explanation. As you can see, I perform th
task, for example "9.5 - A1 -A2 - A3" repeadtely in my workbooks an
want to simply the process to increase the efficiency of m
keystrokes.

Any help will certainly be appreciated.

Thanks again and Best Wishes,

Broc

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Seemingly Easy Question...help would be greatly appreciated

Sub Subtract3()
ActiveCell.Formula = "=" & ActiveCell.Value & " - Sum(" & _
ActiveCell.Offset(0, -3).Resize(1, 3).Address(0, 0) & ")"
End Sub


Assign a shortcut to this using the Options button under Tools=
Macro=Macros.

--
Regards,
Tom Ogilvy




"Btibert " wrote in message
...
I am currently starting learning how to program with VBA. I am able to
see how powerful a tool it can be. This is my problem. I currently
create spreadsheets where I have to repeatedly enter a value in one
cell and subtract the three cells to the left of it. To state my
problem clearly, I am given the annual operating information for a
company and need to "back out" each quarter's results. Therefore, when
looking at an annual report, I only have the annual results for the 4th
quarter, not the observed amount. Therefore, to back out this value, I
have to subtract the previous three quarters from it (three cells to
the left of it).

Ultimately, what I would like to do is type the "running annual total"
in the appropriate Q4 cell, type a shortcut, and have it subtract the
values in the three cells to the left of it. However, to my limited
programming knowledge, I have been trying to use VBA to recognize the
value in the cell and then subtract it from the cells to the left,
however, it is not functioning properly. If need be, I would even be
willing ot have a input box prompt me for the annual total to be used
in the formula.

Since I would be performing this action often, I believe this is a
relative reference issue, and not an absolute cell reference.
Additionally, assuming that the code is relatively simple, I think I
have enough knowledge (or at least be able to figure out) how to create
another macro that lets me subtract only two columns to the left, then
only one column to the left.

I apologize for the long explanation. As you can see, I perform the
task, for example "9.5 - A1 -A2 - A3" repeadtely in my workbooks and
want to simply the process to increase the efficiency of my
keystrokes.

Any help will certainly be appreciated.

Thanks again and Best Wishes,

Brock


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Seemingly Easy Question...help would be greatly appreciated

Thank you very much for your prompt response. It is greatly
appreciated.

Regards,

Brock


---
Message posted from http://www.ExcelForum.com/

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
Easy question (just not for me) Confusicous Excel Discussion (Misc queries) 2 January 4th 10 08:20 PM
If then Help is greatly appreciated! [email protected] Excel Discussion (Misc queries) 11 February 28th 06 11:52 PM
The MS Graph Tool should be debugged and greatly enhanced. tomtomward Charts and Charting in Excel 0 February 22nd 06 03:41 PM
Why does Excel file size increase GREATLY with only a SMALL pictu Bandar Excel Discussion (Misc queries) 1 November 2nd 05 02:17 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM


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"