Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to check column name in multiple sheet

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How to check column name in multiple sheet

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

" 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to check column name in multiple sheet

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple sheet cells in one column Cyberbiker Excel Discussion (Misc queries) 1 January 27th 08 07:24 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
Check for Sheet Password Protected, Unprotect with multiple passwo David Excel Programming 2 June 21st 06 06:19 PM
formula/check for doubling in column in Excell sheet SIRAJ Excel Worksheet Functions 2 February 15th 06 11:26 AM
use of vlookup in case of multiple column check Bharat Saboo Excel Worksheet Functions 1 December 31st 05 04:12 PM


All times are GMT +1. The time now is 07:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"