I am new in VBA and I would like some help in programming with macros
Hi, I have a project to accomplish, in which I must read and compare the values of some cells for example from f11 to f 100 with a certain number lets say 10 and then the cells that their values is greater than 10 I would like to compare the cells of another column, for example if I find at the cell F34 a number greater than 10, then I want to check the K34 cell and see if this value is also greater than 10, if so then copy the value fo the F34 cell and paste it to a new workbook to a specific cell for example A2 , then go back and keep checking, if the F51 is greater than 10, then check the K51 cell and if this value too is greater than 10 then copy the value of the F51 and paste it to the new workbook that has been created to the next row A3 and so , on.
The problem is that I want to do with one macro so I can save it and then use the new workbook as an input for the mathlab.
So, please if anyone can help with some code, or give me some instructions I would really, really appreciate it, as I do not have much experiance with programming in VB
Thank you very much. :cry:
Re: I am new in VBA and I would like some help in programming with macros
Welcome to the Forums.
I think I need some clarification on the issue. Break it down into sections.
What I think you may be able to do is use the If statement in the formula bar.
Re: I am new in VBA and I would like some help in programming with macros
Flowcharts help. As in making one to see how your program will need to flow.
If this is an assignment, there is usually a book or tutor to assist, or at least get you started.
Online there are loads of tutorials, its just a matter of finding what you need and experimenting/learning.
As posted by Rogdog, the initial checks could (in theory) be done with an excel function, but as you want to get them to their own sheet... ;)
Also, you could record a macro to see what it does and how it does it, but in this case I do not think that will help much.
You will need to read up on For...Next loop. Nested Loops and it would be useful for you to at least know a couple of the objects used to reference the sheet and cells (excel help file?).
Post up your code once you have planned what you want to do.
Re: I am new in VBA and I would like some help in programming with macros
I have done this but obviousy is not working, so any help would be very very usefull!! thanx!!
Range("E10").Select
For i = 10 To 40
If Ei > 10 And Fi > 50 Then Range("Ei").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
'Cells(ActiveCell.Row + 1, 1).Select'
Sheets("Sheet1").Select
' Cells(ActiveCell.Row + 1, 1).Select'
Next i
End Sub