View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Excel Macro Help

Lol. I figured that as you had the programming experience, it's the object
model you need.

Just post back if you get stuck.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Sagar" wrote in message
om...
Thanks for your roadmap Bob. This should definitely help getting me
started off. Being completely new to Excel, I'm all the way upto
having the input box to get the Owner name already :)

"Bob Phillips" wrote in message

...
As you already have experience, I will just give you some pointers.

Use InputBox top prompt for the name.

There is a worksheets collection that you can iterate through using For

Each
sh In Worksheets ... Next sh.

You Can use the Find method to find an occurrence, and the FindNext to

find
others. With Find you can specify the range (Columns("B:B")), and test

if
found.

When you do find, it will be a single cell. You can get the whole row

with
cell.EntireRow.Copy, and then paste that.

Good luck.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Sagar" wrote in message
om...
Hi All,

I'm new to VBA programming although I have programming experience with
Java, J2EE, C, C++ etc.

I have a xls file with multiple worksheets. Each worksheet has three
columns which are shown below.

Status Owner Outlook

Now I have to write a macro which requires the user to input a string
to search for an Owner and then will pull all worksheets which has a
particular string in it's name (For e.g the string "Outlook" in it's
name will require me to pull Worksheets "10 Day Outlook", "15 Day
Outlook" and not "10 day schedule), and copy the contents of the row
that matches the "Owner" name that was input and then creates a new
worksheet and pastes this onto the new Worksheet created.

For e.g., Given a excel spreadsheet with 3 worksheets

Worksheet "10 Day Outlook"

Status Owner Outlook
-------------------------
Done John Good
Done Dave Avg

Worksheet "15 Day Outlook"

Status Owner Outlook
-------------------------
Done Vicky Good
Inc Dave Good

Worksheet "10 Day Schedule"

Operation TargetDate
-------------------------
MeasK3Refl 4/27/04

This macro should ask for a name and if the user inputs say "Dave",
should create a new worksheet with the contents

New Worksheet

Status Owner Outlook
-------------------------
Done Dave Avg
Inc Dave Good

Thanks a lot in advance for your help,
Sagar.