Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

syntax question

ResolvedVersion 2016

Diane has attended:
Excel VBA Introduction course
Excel VBA Intermediate course
Excel VBA Advanced course

Syntax question

Hi, How could I modify this code to maintain the format of the source cell? I know I could change the whay I do it, but if I can modify this simple statement I would rather.

Thanks
Range(sCopyFromRange).Copy _
Destination:=Range(sCopyToRange)

RE: Syntax question

Hi Diane,

I think this already does this.

I've just checked with this line and it keeps the formatting applied to A1.

Range("A1").Copy Range("A2")

Does this do what you need?

Let me know if I've misunderstood.

Claire

RE: Syntax question

Hi Claire

No, it isn't taking my formatting across, but I think you are right it should be. I have a cell colour on my source but the cell after copy on the target remains default no colour.

Thanks

Diane

RE: Syntax question

Hi Diane,

Sorry to hear it's not behaving as expected.

Please let us know if you have any further questions.

Claire

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

Fri 6 Sep 2019: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Freeze Rows and Columns to keep lables displayed

You can freeze rows and columns in your worksheet so they don't move.

This allows you to keep row and column labels displayed on your screen as you move through a large worksheet.

Click below and/or to the right of the cell(s) you want to freeze. (NB. Excel freezes ALL the rows above and ALL the columns to left of the selected cell)

Click on the 'Windows' menu and selct 'Freeze Panes'.

Lines appear in your worksheet. The required rows and columns are frozen and remain on your screen as you move through your worksheet.

To unfreeze rows and columns, click on 'Window' menu and select 'Unfreeze Panes'.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.