Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Sub MyHeight() 'Define the height of the row(=tate) of the selected cell.
  2.  
  3. Dim tate_now As Single
  4. tate_now = Selection.RowHeight
  5. tate_now = tate_now / Application.CentimetersToPoints(1)
  6.  
  7. Dim tate As String
  8. tate = InputBox("Type Height (cm).", "Set Height", tate_now)
  9.  
  10. '実行
  11. If tate <> "" Then
  12. Selection.RowHeight = Application.CentimetersToPoints(CSng(tate))
  13. End If
  14.  
  15. End Sub
  16.  
  17.  
  18. Sub MyMerge() 'Merge/Unmerge cells
  19. Selection.MergeCells = Not Selection.MergeCells
  20. End Sub
  21.  
  22.  
  23. Sub MyPrintAreaSetUp() 'Set Selected Area as the Print Area
  24. Dim hani As Range
  25. Set hani = Selection
  26.  
  27. ActiveSheet.PageSetup.PrintArea = hani.Address
  28.  
  29. End Sub
  30.  
  31.  
  32. Sub MyCenter() 'Sentaku_hani_de_chuou
  33.  
  34. With Selection
  35. .HorizontalAlignment = xlCenterAcrossSelection
  36. .VerticalAlignment = xlBottom
  37. .WrapText = False
  38. .Orientation = 0
  39. .AddIndent = False
  40. .ShrinkToFit = False
  41. .MergeCells = False
  42. End With
  43.  
  44. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement