Here is one way :
Option Explicit
Sub TransposeColToRow()
Dim lastCol As Long
With Sheets("Sheet1")
'find the last used column on row 3
lastCol = .Cells(.Columns.Count, 1).End(xlToLeft).Column
.Range(.Range("A1:A24"), .Cells(24, lastCol)).Copy
End With
'paste and translose...
Option Explicit
Sub NewestFile()
Dim MyPath As String
Dim MyFile As String
Dim LatestFile As String
Dim LatestDate As Date
Dim LMD As Date
MyPath = "C:\Users\Documents\"
If Right(MyPath, 1) <> "\" Then MyPath = MyPath & "\"
MyFile = Dir(MyPath & "*.xls"...
Images are blurry, small and very difficult to read. Posting a copy of your workbook to be downloaded would help immensely. Thanks
The data in Sheet 2 doesn't necessarily match up with any field in Sheet 1 ? What field/s are you copying / pasting to Sheet 2 ?
The macro is to be pasted into the ThisWorkbook Module.;
Download the sample workbook and open the VBA coding window. Easiest way is to right click any sheet tab and select VIEW CODE.
On the left side find ThisWorkbook module and double click that. The macro code will display in the right side...
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Res As VbMsgBoxResult
Res = MsgBox("Ensure the data matches V1 prior to closing this file." & vbNewLine & vbNewLine & "OK - CLOSE CANCEL - OPEN", vbQuestion + vbOKCancel, "Check V1 Data")
If Res = vbOK...
If it works for you, then it is proper.
Having said that ... there are usually several different methods to accomplish your goals using Excel. If a challenge has
3 different methods to attain a solution, that doesn't make two of those "bad".
Right click the Tab for SHEET1. Left click on VIEW CODE.
In the large white area on the right hand side, paste the following :
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim MyPicture As Object
Dim MyTop As Double
Dim MyLeft As Double
Dim...
Your keyboard should already have a key that performs this action. Read these two resources :
https://chandoo.org/wp/right-click-from-the-keyboard-not-the-mouse/
https://chandoo.org/wp/replace-formulas-with-values/
Sorry you are not receiving the same results there.
With my single monitor I was able to specify the userform be centered on the screen, then the msgbox would visualize over the userform.
The userform must be "ShowModal = False" in the settings.
Paste in the UserForm :
Option Explicit...