Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. dim i As Integer '''angle variable and row counter on summary page
  2. dim j As Integer '''column counter on summary page
  3.  
  4. i=0
  5. j=1
  6.  
  7. Do While i<57 '''Angles vary from 0 to 56
  8.  
  9. Sheets("Temp_Fit_Page").Select '''changing angle parameter
  10. Range("H4").Value = i
  11.  
  12.  
  13. '''solver section of code which is not included here
  14.  
  15.  
  16. j=1
  17.  
  18. Do While j<49 '''there are 48 output columns
  19.  
  20. If 1 <= j <= 9 Then '''outputting peak positions
  21. Sheets("Temp_Fit_Page").Cells(j + 3, 11).Copy
  22. Sheets("PL_Summary").Cells(i + 2, j + 1).PasteSpecial
  23. End if
  24.  
  25. If 10 <= j <= 18 Then '''outputting peak heights
  26. Sheets("Temp_Fit_Page").Cells(j - 6, 12).Copy
  27. Sheets("PL_Summary").Cells(i + 2, j + 1).PasteSpecial
  28. End If
  29.  
  30. If 19 <= j <= 27 Then '''outputting peak linewidths
  31. Sheets("Temp_Fit_Page").Cells(j - 15, 13).Copy
  32. Sheets("PL_Summary").Cells(i + 2, j + 1).PasteSpecial
  33. End If
  34.  
  35. If 28 <= j <= 36 Then '''outputting peak areas
  36. Sheets("Temp_Fit_Page").Cells(j - 24, 14).Copy
  37. Sheets("PL_Summary").Cells(i + 2, j + 1).PasteSpecial
  38. End If
  39.  
  40. If 37 <= j <= 45 Then '''outputting peak offsets
  41. Sheets("Temp_Fit_Page").Cells(j - 33, 15).Copy
  42. Sheets("PL_Summary").Cells(i + 2, j + 1).PasteSpecial
  43. End If
  44.  
  45. If 46 <= j <= 47 Then '''outputting background gradient and intercept
  46. Sheets("Temp_Fit_Page").Cells(15, j - 35).Copy
  47. Sheets("PL_Summary").Cells(i + 2, j + 1).PasteSpecial
  48. End If
  49.  
  50. j=j+1
  51.  
  52. Loop
  53.  
  54. i=i+1
  55. Loop
  56.  
  57. If 46 <= j <= 47 Then ''' outputting background gradient and intercept
  58. Cells(i + 2, j + 1).Value = j
  59. End If
  60.  
  61. If 46 <= j <= 47 Then ''' outputting background gradient and intercept
  62. Cells(i + 2, j + 1).Value = Sheets("Temp_Fit_Page").Cells(15, j - 35).Value
  63. End If
  64.  
  65. If 1 <= j <= 9 Then '''outputting peak positions
  66. k = j + 3
  67. Sheets("Temp_Fit_Page").Select
  68. Cells(k, 11).Select
  69. Selection.Copy
  70. Sheets("PL_Summary").Select
  71. Cells(i + 2, j + 1).Select
  72. Selection.PasteSpecial
  73. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement