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

access vba courses - vba formula copying

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » access vba courses - VBA Formula copying

access vba courses - VBA Formula copying

ResolvedVersion Standard

Rebecca has attended:
Excel Advanced course

VBA Formula copying

I am trying to copy formula in VBA along 8 coulmns and 10 rows from the activecell.

The activecell is created from the formula finalrow = Cells(65536, 1).End(xlUp).Row - 80 because I am continully adding lines onto the worksheet and finalcolumns = Cells(8, 255).End(xlToLeft).Column

Instead of copying each line of formula and each column of formula, I woul like to know if there is a quicker way of creating a range. I have tried Range ("finalcolumn:finalrow") but this isn't right.

Can you please help

Many thanks

Becky

RE: VBA Formula copying

Rebecca

Try using the following to line of code to select the required range:

Range(Cells(StartRowVal,StartColVal), Cells(EndRowVal,EndColVal)).Select

If you are going to be reffering to this range multiple times you could create a variable for it as shown below.

Dim MyRange as Range

Set MyRange = Range(Cells(StartRowVal,StartColVal), Cells(EndRowVal,EndColVal))


Hope this helps

Carlos



 

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.

Access tip:

Prefixed Autonumbering

When using Date Type = Autonumber as a primary key, clients may require autonumbering to be prefixed with a letter.

For example, P001, where P is the prefixed letter

Instructions
Step 1. Create Field Name
Step 2. Set Data Type to Autonumber
Step 3. Within Field Property General tabsheet,
enter Format property as [backslash]P000



View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.