Results 1 to 10 of 10

Thread: Transferring a "score" achieved to an excel cell using offset and count...

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    7

    Transferring a "score" achieved to an excel cell using offset and count...

    Hi all new to this forum, I have a headache of code here I do hope someone can help me out a little with it.

    Within my program I have a scoring system using a counter determined by an answer i.e. if a combobox value = yes then add one to the counter.

    A percentage is then calculated and displayed on an output worksheet. The answers are displayed on the output sheet and stored in a table format, when another set of results is entered it overwrites the output sheet and stores on the next line of the table using:
    Code:
    Dim e As Range, el As Range                             
    Set e = Worksheets("SHEETNAME").Range("A3:AM3").CurrentRegion    
    Set el = e.Offset(e.Rows.Count, 0)
    I am using arrays to allow the user to pick a row from results in the table and copy across and overwrite the output sheet.
    I want the percentage calculated to display in the end available cell ie. AK3then AK4 coinciding with the results on the same row(at the end) this is calculated within a separate sub function which creates the problem.
    I am using:
    Code:
    Set e = Worksheets("SHEETNAME").Range("AN3").CurrentRegion
    Set el = e.Offset(e.Rows.Count, 0)
    el.Cells(1).Value = Score
    but this puts it on the next line i.e. A4. It must be due to there already being results on that row so its counting this then adding to the next one. I know i need to tweak the
    Code:
    e.Offset(e.Rows.Count, 0)
    But I cannot figure out how to.
    I have tried to attack the issue using
    Code:
    Set e = Worksheets("Letter").Range("AN3:AN600").CurrentRegion
    Set el = e.Offset(e.Rows.Count, 39)
    el.Cells(1).Value = Score
    ActiveCell.Cut
    Range("AN3:AN600").Offset(-1, 0).Select
    ActiveSheet.Paste
    But this also does not work can someone help me out? I know I am nearly there so frustrating!!!

    Thanks
    Last edited by DogDee; Feb 8th, 2010 at 09:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width