Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Clark Butler   on Oct 19 In MS Office Category.

  
Question Answered By: Lonnie Rogers   on Oct 19

with your help  I "simplified" to the following code. In
theory, this will allow the data to be transferred to the correct row
depending on which page I want to transfer my data to.

The code works fine when iGroupNum doesn't have a "01" or "02
appendage. But it's erroring when it gets to (Left(iGroupNum,
Len(iGroupNum) - 2))

Am I using the correct nomenclature here?

---------------------

If Right(iGroupNum, 2) = "01" Then
If TissueData Then
iGroupNum = ((Left(iGroupNum, Len(iGroupNum) - 2)) - 1) * 6 + 10
Else
iGroupNum = (Left(iGroupNum, Len(iGroupNum) - 2)) * 2 + 8
End If
ElseIf Right(iGroupNum, 2) = "02" Then
If TissueData Then
iGroupNum = ((Left(iGroupNum, Len(iGroupNum) - 2)) - 1) * 6 + 13
Else
iGroupNum = (Left(iGroupNum, Len(iGroupNum) - 2)) * 2 + 9
End If
Else
If TissueData Then
iGroupNum = ((iGroupNum - 1) * 6) + 10 'account for new group
every 3 rows
Else
iGroupNum = iGroupNum * 2 + 8 'new group each row
starting at row 5
End If
End If

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Len function help Or get search suggestion and latest updates.


Tagged: