copying records

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Copying Records

Copying Records

resolvedResolved · High Priority · Version 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:

Use the Ctrl-key for quick navigation in Excel 2010

If you want to move quickly to the right, left, top or bottom of your spreadsheet, just press Ctrl and one of the arrow keys. If you want to then select all the data in that particular row or column, hold down the Shift key and press Ctrl and an arrow key.

View all Excel hints and tips


Server loaded in 0.07 secs.