0

以下を投稿すると、フィニッシャーの部門ランキングを報告するセルに #VALUE が返されます。.Cells(lRow, 5).Value で指定された完走者の部門を、それより早く完走したすべての人と比較し、適切なランキング (数値 1、2 など) を返す必要があります。

   With ws
  .Cells(lRow, 1).Value = Me.DTPicker1.Value 'Date/Time Stamp
  .Cells(lRow, 2).Value = Me.ComboBox1.Value 'Bib Number
  .Cells(lRow, 3).Value = Me.TextBox1.Value 'First Name
  .Cells(lRow, 4).Value = Me.TextBox2.Value 'Last Name
  .Cells(lRow, 5).Value = Me.TextBox6.Value 'Division

  'Compute Division Ranking

  Dim Rng As Range
  Dim c As Range
  Set Rng = Range(Cells(1, 5), Cells(lRow, 5))
  For Each c In Rng
      .Cells(lRow, 6).Value = Application.Rank(c.Value, Rng, 1)
  Next c
4

1 に答える 1

0

暗闇の中でのショット:

   With ws
  .Cells(lRow, 1).Value = Me.DTPicker1.Value 'Date/Time Stamp
  .Cells(lRow, 2).Value = Me.ComboBox1.Value 'Bib Number
  .Cells(lRow, 3).Value = Me.TextBox1.Value 'First Name
  .Cells(lRow, 4).Value = Me.TextBox2.Value 'Last Name
  .Cells(lRow, 5).Value = CLng(Me.TextBox6.Value) 'Division

  'Compute Division Ranking

  Dim Rng As Range
  Dim c As Range
  Set Rng = Range(Cells(1, 5), Cells(lRow, 5))
  For Each c In Rng
      .Cells(lRow, 6).Value = Application.Rank(c.Value, Rng, 1)
  Next c
于 2013-09-23T21:11:21.530 に答える