この作業を行うためにいくつかのVBAを操作しようとしましたが、どこにもないようです。データがある既存の行の上に行を挿入するマクロ
データを持つ行の上に新しい行を挿入し、セル1と2のデータをその新しい行にコピーするマクロを書きたいとします。
私は私が持っているものの絵を入れて、私は
追加の写真が欲しいものの写真:ここ
は、私が使用したコードですが、私はそれがする必要があります次の行を続けてください:
Sub InsertRowandCopyCell1and2()
'
' InsertRowandCopyCell1and2 Macro
'
' Keyboard Shortcut: Ctrl+w
'
Rows("78:78").Select
Selection.Insert Shift:=xlDown
Range("A79:B79").Select
Selection.Cut
Range("A78").Select
ActiveSheet.Paste
Rows("78:78").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
Rows("92:92").Select
Selection.Insert Shift:=xlDown
Range("A93:B93").Select
Selection.Cut
Range("A92").Select
ActiveSheet.Paste
Rows("92:92").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
Rows("96:96").Select
Selection.Insert Shift:=xlDown
Range("A97:B97").Select
Selection.Cut
Range("A96").Select
ActiveSheet.Paste
Rows("96:96").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -9.99786370433668E-02
.PatternTintAndShade = 0
End With
End Sub
はSOへようこそ!あなたが持っている(現在のフォームで)コードの試行を投稿してください。 –