943,097 Members | Top Members by Rank

Ad:
Feb 7th, 2010
0

Adding an amount "scored" to a cell in excel, then the one below.....

Expand Post »
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:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim e As Range, el As Range
  2. Set e = Worksheets("SHEETNAME").Range("A3:Ak3").CurrentRegion
  3. 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:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Set e = Worksheets("SHEETNAME").Range("AK3").CurrentRegion
  2. Set el = e.Offset(e.Rows.Count, 0)
  3. 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
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. e.Offset(e.Rows.Count, 0)
But I cannot figure out how to.
I have tried to attack the issue using
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Set e = Worksheets("Letter").Range("AN3:AN600").CurrentRegion
  2. Set el = e.Offset(e.Rows.Count, 39)
  3. el.Cells(1).Value = Score
  4. ActiveCell.Cut
  5. Range("AN3:AN600").Offset(-1, 0).Select
  6. ActiveSheet.Paste
But this also does not work can someone help me out? I know I am nearly there so frustrating!!!

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DogDee is offline Offline
3 posts
since Feb 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: (- -)need help on how to make my vb6 program to exe
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Facin problem with login





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC