+ Reply to Thread
Results 1 to 2 of 2

Only perform formula when column A contain data

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    Malaysia
    MS-Off Ver
    MS Office 2013
    Posts
    1

    Only perform formula when column A contain data

    Hi, i need some helps from you guys regarding excel macro.

    Please kindly refer my attached sample.xls.

    Sample.xlsx

    I actually want to use macro to create formula as in column B, C and D based on column A.
    This is the list generated by other program in .csv format.
    Everytime it will write a series of '1' and '0' in column A, the length will varies depends on the sampling rate.

    Column D is the outcome that i want, which is display how many '1' at each of the end of series '1'
    But before that i need to check how many data's in column A before i only apply those formula to column B, C and D when column A contain data.

    I believe i need to use loop to keep track column A data range, let say 20 cells got data, then it will set 20 to a variable, say k = 20,
    then next time column B will apply formula based on 'k' range.

    Can any one enlighten me?
    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Only perform formula when column A contain data

    Since it seems the only reason B and C exist is to help get the values in D, I don't think you really need them.

    The following code counts the 1's in column A and outputs to column B.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 03-12-2013, 04:10 PM
  2. [SOLVED] Find last data and perform insert column
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-25-2012, 01:27 AM
  3. Perform formula then overwrite data in macro
    By carrdie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2010, 09:33 AM
  4. Perform a two column lookup that returns a value from another column?
    By okstate1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2010, 07:13 PM
  5. Replies: 2
    Last Post: 08-02-2006, 04:40 PM

Bookmarks

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 Friendly URLs by vBSEO 3.6.0 RC 1