+ Reply to Thread
Results 1 to 2 of 2

Help making This code easier

Hybrid View

  1. #1
    Registered User
    Join Date
    04-29-2004
    Posts
    92

    Help making This code easier

    if isnumeric (sheets("sheet1").range ("a1")) then
    sheets("sheet1").range("a2") = sheets("sheet1").range ("a1") _
    + sheets("sheet1).range ("a2")
    end if

    Is the code, in which i need to do to about 50 cells. Im just wondering if I could put a a1:a15 in there somewhere. Right now I basically have 50 lines of code so i figure theres probably an easier way. Its possible there isnt so im just asking


    Thanks
    Chris

  2. #2
    Registered User
    Join Date
    08-18-2004
    Posts
    16
    Hi Chris,
    Try this...

    Dim c as range
    For each c in sheets("sheet 1").range("A1:A15")
    If isnumeric(c.value) then
    c.offset(1,0).value = c.value + c.offset(1,0).value
    end if
    Next c
    c.offset(1,0) looks for the cell 1 row down

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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