I have a simple Excel file I use to clean up cell entries, the final cell needs to be copied and pasted with paste/special/”Values” to a different Workbook, Worksheet, and Cell.
Ever time I run the Macro, the results need to go to a different Cell and there will or may be different worksheets or workbooks also.
It needs to copy Cell F6 of Workbook containing the Macro, wait for the cell selection of recipient cell and paste the value of the copied data there upon mouse selection.
This code works but without the freedom to choose the final cell, I need help with:
Range(“F6”).Select needs to also point to workbook containing the Macro.
Windows(“test.xlsx”).Activate and Range(“B2”).Select. How do I make these a Selectable by mouse click?
' Macro2 Macro
'
'
Range("F6").Select
Selection.Copy
Windows("test.xlsx").Activate
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub
Louis DeLellis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.