PC Review


Reply
Thread Tools Rate Thread

How to check column name in multiple sheet

 
 
suraj228@gmail.com
Guest
Posts: n/a
 
      22nd Mar 2007
How to write a macro which will open up a dialogue box and asked user
to select a particular excel file.Now selecting a excel workbook which
has multiple worksheets. such as A1, A2, A3 ...etc. Each worksheet has
a column name(e.g, class name, parent name..). It should copy the
content of each worksheet to another file based on column name
checking(i,e,if the column name is same) some value.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      23rd Mar 2007
Your description of the requirement is pretty vague but I have put
together a scenario to give you an idea of an approach to a solution.

1. How to write a macro which will open up a dialogue box and asked user
to select a particular excel file.

-Let's start with the simple Method

selectFile = InputBox("Enter one of the following file names:" & Chr(13) &
"FileName1" & Chr(13) & "FileName2", "File Name")
'The Chr(13) inserts a carriage return so the files will be on separate lines.

2. Now selecting a excel workbook which has multiple worksheets. such as
A1, A2, A3 ...etc.

-This should be the result of the selection in 1 above

Workbooks.Open Filename:=selectFile

3. Each worksheet has a column name(e.g, class name, parent name..).

- This is normally developed by the creator of the workbook.

4. It should copy the content of each worksheet to another file based on
column name

checking(i,e,if the column name is same) some value.

- Assuming the range is named myRange

If myRange cells(1, 1) <> "" Then
Worksheets(1).Cells.Copy Workbooks(2).Worksheets(1).Range("A1")
End If

"(E-Mail Removed)" wrote:

> How to write a macro which will open up a dialogue box and asked user
> to select a particular excel file.Now selecting a excel workbook which
> has multiple worksheets. such as A1, A2, A3 ...etc. Each worksheet has
> a column name(e.g, class name, parent name..). It should copy the
> content of each worksheet to another file based on column name
> checking(i,e,if the column name is same) some value.
>
>

 
Reply With Quote
 
suraj228@gmail.com
Guest
Posts: n/a
 
      26th Mar 2007
hi,
thanks for the suggestion, but my problem is not yet resolved.
Actually I want to open a excel workbook which contains multiple
worksheet. Each work sheet has column name. Now i want to check if the
column name given in that particular worksheet is (eg sr. no, class
name, parent name, description), if it matches then only open that
work book otherwise pop up a error message.so what should be the macro
code for that....

thanks in advanced
suraj

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple sheet cells in one column Cyberbiker Microsoft Excel Misc 1 27th Jan 2008 07:24 PM
Can I print a single column sheet as multiple columns? =?Utf-8?B?YWh1dGNoMjE=?= Microsoft Excel Misc 1 25th Jan 2007 09:32 PM
Check for Sheet Password Protected, Unprotect with multiple passwo =?Utf-8?B?RGF2aWQ=?= Microsoft Excel Programming 2 21st Jun 2006 06:19 PM
formula/check for doubling in column in Excell sheet =?Utf-8?B?U0lSQUo=?= Microsoft Excel Worksheet Functions 2 15th Feb 2006 11:26 AM
use of vlookup in case of multiple column check =?Utf-8?B?QmhhcmF0IFNhYm9v?= Microsoft Excel Worksheet Functions 1 31st Dec 2005 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:48 PM.