LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default How to branch?

Excel Experts:

My VBA skills allow me to delete columns, add numbers and such, but I don't
know how to structure code to take different actions based on conditions.

My spreadsheet is similar to the following:

A B C
1 Existing Positions:
2 AMD 50
3 DELL 75
4 MSFT 100
5 New Trades:
6 Type Symbol Shares
7 ADD AMD 25
8 SELLPARTIAL DELL 50
9 SELLALL MSFT 100

I want my program to take a different action on an Existing Position, based
on the Type of the New Trade. For the new trade in AMD, Type ADD, I want to
add the 25 new shares to the existing 50 shares. For DELL, type SELLPARTIAL,
I want to reduce the exising shares by 50. For MSFT, type SELLALL, I want to
move the existing position to a different part of my spreadsheet.

I think I want to use a Select Case structure, as I have 8 different Types.

How would I structure the code?

Thanks,
Alan

--
achidsey
 
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
Calculating the distance customers live from a branch office Steve Cornelius Excel Worksheet Functions 5 September 6th 08 02:00 AM
Write a branch to another macro iashorty Excel Worksheet Functions 5 April 10th 08 01:29 PM
how do i create chart like branch-sector sales & collections Gnana Prasad Excel Discussion (Misc queries) 1 January 11th 08 08:00 AM
How can I contact branch Office in Tokyo, Japan? newbird New Users to Excel 0 May 21st 06 03:19 PM
Establish a Branch of Clayton College here in Malaysia Datuk Dr. Mat Lazim Excel Worksheet Functions 2 July 8th 05 11:32 PM


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