SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Advanced Member RKY's Avatar
    Join Date
    Aug 2006
    Location
    Hyderabad, India
    Posts
    586
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Excel - Problem faced in Writing Macros


    Everybody,
    I am writing macros in excel which will calculate the game logic internally, and executing the macro at run time from the code. I have question here. How to update the cell value based on the previous cell value.
    Example:

    A1 = 1

    If A1=1 i need to update the few cells by other values

    B2=1
    B3=1
    D4=1
    D6=1

    Your suggesstions are highly appriciable, I tried and i got a error messahe as Class does not support automation or does not support expected interface.

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Excel - Problem faced in Writing Macros

    There are so many different ways you can do it. You can use formulas or you can use code logic

    Forumala of Cell B2 would be ="IF(A1=1,1,0)" and similarly. Else by logic you can do

    <font class="small">Code:</font><hr /><pre>
    if xlsWorkSheet.Cells(1,"A").value = 1 then
    xlsWorkSheet.Cells(2,"B").value = 1
    end if

    if xlsWorkSheet.Cells(1,1).value = 1 then
    xlsWorkSheet.Cells(2,2).value = 1
    end if
    </pre><hr />

  3. #3
    Advanced Member RKY's Avatar
    Join Date
    Aug 2006
    Location
    Hyderabad, India
    Posts
    586
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Excel - Problem faced in Writing Macros

    Thanks tarun.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:23 PM.

Copyright BetaSoft Inc.