J
Jim
I have been using the macro below to copy the first cell and then copy to
all other cells on the Sheet. However with Labels I actually need to copy to
every other
cell horizontally, and then miss the next row of cells, as they are used
for vertical spacing
and then copy every other cell again, as the gap is needed to space the
label horizontally,
so it becomes tedious to delete the contents of every other Cell. Can this
macro be easily modified?
Jim
Sub TableFillWithThisCell()
' Fills all cells in current table with contents of current cell
Dim objSelObj As Cell
Application.ScreenUpdating = False
On Error Resume Next ' In case insertion point is not within a table or
selected range is not within one cell
Selection.SelectCell
If Err.Number <> 0 Then
Beep
Exit Sub
End If
On Error GoTo 0
Set objSelObj = Selection.Cells(1)
Selection.Copy
Selection.SelectRow
Selection.SelectColumn
Selection.Paste
objSelObj.Select
Selection.Collapse
Application.ScreenUpdating = True
End Sub
all other cells on the Sheet. However with Labels I actually need to copy to
every other
cell horizontally, and then miss the next row of cells, as they are used
for vertical spacing
and then copy every other cell again, as the gap is needed to space the
label horizontally,
so it becomes tedious to delete the contents of every other Cell. Can this
macro be easily modified?
Jim
Sub TableFillWithThisCell()
' Fills all cells in current table with contents of current cell
Dim objSelObj As Cell
Application.ScreenUpdating = False
On Error Resume Next ' In case insertion point is not within a table or
selected range is not within one cell
Selection.SelectCell
If Err.Number <> 0 Then
Beep
Exit Sub
End If
On Error GoTo 0
Set objSelObj = Selection.Cells(1)
Selection.Copy
Selection.SelectRow
Selection.SelectColumn
Selection.Paste
objSelObj.Select
Selection.Collapse
Application.ScreenUpdating = True
End Sub