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

copying records

ResolvedVersion 2007

Lee has attended:
Excel VBA Intro Intermediate course

Copying Records

Is it possible for the content of a cell to be copied if the value of the cell is greater than zero ?

we created a code that had the following to copy the data in the cell if the salesperson name matched strName

If Sheets("Total Sales").Range("a10").Cells(introwcount, 10).Value = strName Then

Can the last bit be changed to somehting like this

If Sheets("Total Sales").Range("a10").Cells(introwcount, 10).Value = > 0

to copy all the content when the value of the cell is greater than zero

The code i have given below still copies all records even when there is a "0" in the reference cell.

Thanks
Lee

RE: Copying Records

Hi Lee

Thanks for your question

your code

If Sheets("Total Sales").Range("a10").Cells(introwcount, 10).Value = > 0


Is copying it if it is greater than OR equal to 0

Try

If Sheets("Total Sales").Range("a10").Cells(introwcount, 10).Value > 0


(without the = )

Instead

Regards

Stephen


 

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:

Removing border lines on the keyboard

Highlight your cell(s) that have boreders on them and press CTRL + SHIFT + _, this will then remove the border lines.

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.13 secs.