日期:2014-05-18  浏览次数:20841 次

100分紧急求助vba转换成c#可操作代码,路过的都进来捧个场,谢谢谢谢 !·
Sheet1.Range("A1") = "题名"
  Sheet1.Range("B1") = "作者"
  Sheet1.Range("C1") = "机构"
  Sheet1.Range("D1") = "期刊名"
  Sheet1.Range("E1") = "年份"
  Sheet1.Range("F1") = "期号"
  Sheet1.Range("G1") = "页码"
  Sheet1.Range("H1") = "issn"
  Sheet1.Range("I1") = "cn"
  Sheet1.Range("J1") = "馆藏号"
  Sheet1.Range("K1") = "关键字1"
  Sheet1.Range("L1") = "关键字2"
  Sheet1.Range("M1") = "关键字3"
  Sheet1.Range("N1") = "关键字4"
  Sheet1.Range("O1") = "关键字5"
  Sheet1.Range("P1") = "关键字6"
  Sheet1.Range("Q1") = "关键字7"
  Sheet1.Range("R1") = "关键字8"
  Sheet1.Range("S1") = "关键字9"
  Sheet1.Range("T1") = "关键字10"
  Sheet1.Range("U1") = "关键字11"
  Sheet1.Range("V1") = "关键字12"
  Sheet1.Range("W1") = "分类号"
  Sheet1.Range("X1") = "文摘"
   
  For sRow = 1 To vLen
  If Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【题 名】" Then
  vRow = vRow + 1
  Sheet1.Range("A" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【作 者】" Then
  Sheet1.Range("B" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【机 构】" Then
  Sheet1.Range("C" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【刊 名】" Then
  Sheet1.Range("D" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 7) = "【ISSN号】" Then
  Sheet1.Range("H" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 8)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 7) = "【C N 号】" Then
  Sheet1.Range("I" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 8)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【馆藏号】" Then
  Sheet1.Range("J" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【关键词】" Then
  Sheet1.Range("K" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【分类号】" Then
  Sheet1.Range("W" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  ElseIf Left(Trim(Sheet2.Range("A" & sRow).Text), 5) = "【文 摘】" Then
  Sheet1.Range("X" & vRow) = Mid(Trim(Sheet2.Range("A" & sRow).Text), 6)
  End If
  Next sRow