|
-
Apr 5th, 2005, 04:59 PM
#1
Thread Starter
New Member
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.
-
Apr 5th, 2005, 10:57 PM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 6th, 2005, 07:52 AM
#3
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.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 15th, 2005, 10:47 AM
#4
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|