私はテーブルからのデータのみの検証をコピーしたいと呼ばれるTable1_1ワークシートテンプレートに(メイント。)テーブルに別のワークシートTEMPLATEにあります。私は利用可能なトピックを見てきましたが、私が探しているものに非常に近いものはありません。コピーデータの検証は
問題の1つは、これらのシートのいずれかの表がシフトする可能性があるため、このマクロを作成する際に考慮する必要があります。
は、これまでのところ私が持っているものです:ワークシートTEMPLATE(。メイント)上Table1_1の
- コピー最初の(そして唯一の行)。
- ワークシートのセルA3を見てテンプレートを取得し、それが属するテーブルを取得します。
- 手順2で見つかった表の最初の行を見つけます。
- 最初の行の表のすべての列のデータ検証を貼り付けます。
- テーブルのすべての行について手順3と4を繰り返します。
私がこれまで持っているコード:
Dim TotalSheets As Integer
Dim p As Integer
Dim iAnswer As VbMsgBoxResult
' This Dim is supposed to be to add worksheets, for the process _
' of copying the data validations to the new sheets, to a skip _
' list. An array perhaps? Skip any sheets listed in this array?
Dim DNCToShts As ?
' The cell to get the table that it is apart of for copying from _
' the other worksheet, "TEMPLATE (Maint.)"
Dim GetCellsTable_Copy As String
' The cell to get the table that it is apart of for pasting onto _
' the other worksheets.
Dim GetCellsTable_Paste As String
' This is the cell to reference on "TEMPLATE (Maint.)" worksheet _
' to get the table name of, this will always be "Table1_1"
GetCellsTable_Copy = "A3"
' This is the cell to reference on each sheet to get the table name.
GetCellsTable_Paste = "A3"
With Aplication
.DisplayAlerts = False
.ScreenUpdating = False
End With
iAnswer = MsgBox("You are about to copy data validations! Do you _
want to proceed?", vbOKCancel + vbExclamation _
+ vbDefaultButton2 + vbMsgBoxSetForeground + vbApplicationModal, _
"Copying Data Valadations")
' Instead of copying the whole table I just need to copy the first row _
' of data, intending to copy just the data validations portion.
Range("Table1_1").Copy
If iAnswer = vbYes Then
p = 1 To Sheets.Count
If UCase$(Sheets(p).Name) <> DNCToShts
StoreTableName = Range(GetCellsTable_Paste).ListObject.Name
私は私が私のエクセルVBAモジュールのそれぞれに達成することを目指しています何示す図を作成しました。これはすべての詳細を含まなくてもよいと私はパート1にのみを働いている点に注意してください:。
Private
関数であるべき私はすでに蓄積されているコードを追加した@TheGuyThatDoesntKnowMuch参照 –のためにあなたのコードの一部または全部を投稿してください。あなたが集めることができるものがあるのか、それ以上説明する必要がありますか? –
私は基本的に上に貼り付けられている以外のコードはほとんど書かれていません。 : -/ –