[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

How can I format the selected range using two lines shown?

I'm using the "Copy & Paste" Code as shown below and I would like to format the selected range as a Date & change the alignment.

rngSrc.Offset(, 2).Copy
rngDst.Offset(LastRow, 5).PasteSpecial xlPasteValues

I have tried the below without any success.

Selection.NumberFormat = "m/d/yyyy"
            With Selection
                .HorizontalAlignment = xlRight
                .VerticalAlignment = xlBottom
                .WrapText = False
                .Orientation = 0
                .AddIndent = False
                .IndentLevel = 0
                .ShrinkToFit = False
                .ReadingOrder = xlContext
                .MergeCells = False
            End With

Can someone help?

THANKS
0
user2073
Asked:
user2073
1 Solution
 
NorieCommented:
Replace Selection with the range you want to format, rngDst.Offset(LastRow, 5).
0
 
user2073Author Commented:
Thank you for your help. I'm moving forward and have achieved great results only with you assistence.

THANKS
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now