Stop Dates Transposing

cwhaley1

New Member
Joined
Nov 22, 2017
Messages
32
Hello,

I have a code which takes the data from a range and copy/pastes it onto the row of a table (on a separate sheet) which bears the same name as the tab.

It works very well, but fails me when it changes the format of the data. The data I'm copying over is in the format dd/mm/yyyy, however Excel is pasting it in the format mm/dd/yyyy.

I know this format is the standard in Excel as that's the way it was written, but to the users of this workbook the dd and mm are the wrong way around.

I'm not clever enough to work out how to amend the below to fix this! Is there a way?

VBA Code:
  Set sh1 = Sheets("Document Date Log")
  For Each sh In Sheets
    If sh.Name <> sh1.Name Then
      Set f = sh1.Range("A:A").Find(sh.Name, , xlValues, xlWhole, , , False)
      If Not f Is Nothing Then
        f.Offset(, 1).Resize(1, 12).Value = Application.Transpose(sh.Range("H5:H16").Value)
      Else
    End If
    End If
  Next
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Remove '.Value' from
VBA Code:
Application.Transpose(sh.Range("H5:H16").Value)
 
Upvote 1

Forum statistics

Threads
1,214,834
Messages
6,121,874
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top