Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie help...VBA w/ Excel
Hi Everybody:
I'm a newbie to the whole VBA thing so I was wondering if somebody could point me towards the right direction for this. Basically what I want to do is in a Excel worksheet I want to check if Column B in page 2 has the word "True" in it. if it does, I want to copy the whole row. It doesn't seem hard but i'm not too familar w/ VBA. Could someone help me get started? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie help...VBA w/ Excel
Turn on the macro recorder and name your macro.
Select your range of data. Turn on AutoFilter Filter on column B for True Copy Select your target sheet Paste. Then use Tools Macros Visual Basic Editor. In Module 1 you can find the code generated. There are ways to loop through the records looking for True, but they are generally a lot less efficient than the AutoFilter. -----Original Message----- Hi Everybody: I'm a newbie to the whole VBA thing so I was wondering if somebody could point me towards the right direction for this. Basically what I want to do is in a Excel worksheet I want to check if Column B in page 2 has the word "True" in it. if it does, I want to copy the whole row. It doesn't seem hard but i'm not too familar w/ VBA. Could someone help me get started? . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie help...VBA w/ Excel
A good place to start understand VBA would be to record some macros while
you use Excel to do what you describe, then look at the code. I'd suggest that you record the process in parts to keep the code comparatively simple and easier to understand. Try to keep the recording to one specific task and avoid a lot of unnecessary selecting and clicking around in the workbook. Re-record macros that don't work out. Delete or overwrite ones that are no good. Once you understand the code associated with individual tasks, you'll be better prepared to understand or build the whole. Record finding True in column B of sheet 2, then stop the recording. Record copying a row, then stop the recording. Look at the results. To find the code, from Excel press, Alt+F8 (Or go to Tools Macro Macros), pick the macro you recorded. Click Edit. If you have the VBA help files installed, you can place you cursor on most keywords in the code, press F1, and Help will open to the article pertaining to the keyword. If you don't have the VBA help files on your computer, and intend to do much VBA, I suggest that you get them. The are always (I think) on the Office CD but are not usually part of the default Office installation. -- Bob Kilmer "Joe" wrote in message ... Hi Everybody: I'm a newbie to the whole VBA thing so I was wondering if somebody could point me towards the right direction for this. Basically what I want to do is in a Excel worksheet I want to check if Column B in page 2 has the word "True" in it. if it does, I want to copy the whole row. It doesn't seem hard but i'm not too familar w/ VBA. Could someone help me get started? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie help...VBA w/ Excel
Using Find on a selected column (or other range of cells) is another
effective alternative to literally looping through each cell or record. -- Bob Kilmer "Joe" wrote in message ... Turn on the macro recorder and name your macro. Select your range of data. Turn on AutoFilter Filter on column B for True Copy Select your target sheet Paste. Then use Tools Macros Visual Basic Editor. In Module 1 you can find the code generated. There are ways to loop through the records looking for True, but they are generally a lot less efficient than the AutoFilter. -----Original Message----- Hi Everybody: I'm a newbie to the whole VBA thing so I was wondering if somebody could point me towards the right direction for this. Basically what I want to do is in a Excel worksheet I want to check if Column B in page 2 has the word "True" in it. if it does, I want to copy the whole row. It doesn't seem hard but i'm not too familar w/ VBA. Could someone help me get started? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
frustrated excel newbie | Excel Worksheet Functions | |||
Real Newbie newbie question | New Users to Excel | |||
help for an excel newbie | Excel Worksheet Functions | |||
Please help an Excel Newbie! | New Users to Excel | |||
Excel 97 Tutorials for VBA Newbie | Excel Programming |