Question

Excel: How to filter data with merged cells

Asked by: Pabilio

Hi,

I have the attached spreadsheet that contains data in columns B to K Merged depending on how many products a customer has buyed.

I.E. Mr John has purchased three different products... so Cells in columns A show the order Nº three times, then Column B to K has it cells merged according the quantity of products (in this case the high of the cell is three rows) then columns L to R are single cells (as column A)

My problem is that I need to filter the data by column D (Which always is a Date value) and when I do this the data showed is only for the 1st row of the merged cells.

The solution could be by Filtering options or better by code triggered by a button that use the value in cell B1 and Filter the data of column D (The value in B1 will always be the value to filter the data when need it previous to print the Sheet).

Could you help me with this please ?

Thank you,
Roberto.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-11-05 at 10:25:35ID24875473
Tags

EXCEL

,

MACRO

,

VISUAL BASIC

Topics

Microsoft Excel Spreadsheet Software

,

Visual Studio

,

Visual Basic v1.0.5.x

Participating Experts
1
Points
500
Comments
30

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. needing instructions for centering data within A1 and B1 c…
    Hi Everyone: I am in the process of creating a checklist using the spreadsheet utility built into Microsoft Works 7.0. At this point, I am needing to know how to center some information which was typed into A1 and carries over into B1 cell. Any information ...
  2. merging cells
    I asked a question about merging cells and I got a very good answer for displaying the contents on one single line. It works fine. I have problem in displaying the contents on different line with this command: =A1 & CHAR(10) & B1 & CHAR(10) & D1 all I get is...
  3. Merging Cells
    Hey everybody, I'm working on a project where I am working Excel through Javascript. Anyways, I need to find a way to merge two cells together using a Function, because how im outputting into excel is primarily through functions, and i need the merges to be automatic. If any...
  4. Merged cells giving RANGE verses cell
    Hi Weird problem. I have a spreadsheet that when I select a merged cell in a formula, it gives me the range. Example A1, B1, C1 are merged cells. Effectively they should be A1. However, when I select the cell to put in a formula, it gives me =A1:C1 which of course me...
  5. Merging cells
    I have two columns in a spreadsheet that I want to merge into one column. Here is what I have: A B Joe Schmo Here is what I want A Joe Schmo (space must be between the entries) Does anyone know how to do this?
  6. Selecting cells to merge
    I am using the TransferSpreadsheet command in Access to export to Excel. I'm then calling this function to add formatting. I'm having an issue on line 28 getting the correct cells selected to merge. I would like to select row 1 columns A to cnt. I'm not sure if Range is c...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: saurabh726Posted on 2009-11-05 at 10:33:39ID: 25752405

To do what you are looking for,There are two options which are availble,

First You have to unmerge the cells and then fill the value in it since when you merge it it considers the value is filled in the top most cell only.

Second Unmerge the cells fill the value in the top cell and copy and paste it over in all the cells and then merge again and by doing this way your value will apear even irrespective the cell is merge.

Enclosed is the workbook for your reference where i filled values in row-15 to 20 in column-D a random date, Now even if you apply filter on Column-A individually it will still show that date.

Saurabh...

 

by: PabilioPosted on 2009-11-05 at 10:53:39ID: 25752622

Hi Saraubh,

My mistake...

When I said filtered by column D, is column C, that is where the date is located.

I know I can use the solution you said, but is exactly what I'm triying to avoid due that the File could have more than 300 lines per day that need to be filtered.

I'm attaching here the two original files where you can see the code in (DATA BASE.xls) that copy some previously filtered values there and paste it and format it in LOAD.xls. (Where I need to filter by date) (To run the code LOAD must be opened and DATA BASE must have the filters on and activated...normally by column D)
The reason to merge the cells is that the information the user will write there (columns D to K) is common to the same customer delivery.

Could you please check the code and see if there is any chance to achieve what I need without the manually filling part ?... If is not possible what I need just let me know.

Thank you for your time,
Roberto.

  • LOAD.xls
    • 46 KB

    Here is where I need to Filter with merged cells

  • DATA-BASE.xls
    • 605 KB

    Here is the code that Copy the filtered values

 

by: saurabh726Posted on 2009-11-05 at 11:19:01ID: 25752875

There are lot of codes there are in your workbook, Tell me which code you want me to audit and for what..?

 

by: PabilioPosted on 2009-11-05 at 11:45:46ID: 25753140

Saurabh,

I believe the solution could be changing the code attached in the snippet (which is the code of Command Button 1 in DATA BASE.xls).

If column D in LOAD.xls is not merged when running the code there is a step less to do if I need to fill it manually....
BUT .... (I believe if) instead of merging the cells in column D when pasting the selection of filtered rows, Do you think is posible that When this code runs (pressing command button 1 in DATA BASE.xls) the code ASK for a date (Must be in a format Date dd/mm/yyyy) and then this value be pasted it  in all cells (not merged) of the selection in Column D  in LOAD.xls ?... (Hope I could explain it well)

If this is possible then I do not need to fill manually the Date and I can filter by column D without problem...

Sorry if I'm bothering you with this problem, is not my intention... I really appreciatte your help.

Roberto.




Private Sub CommandButton1_Click()
 
If Not ActiveSheet.FilterMode Then
   MsgBox "DEBE FILTRAR POR CLIENTE ANTES DE PROCEDER A ENVIAR LA INFORMACION AL CUADERNO DE ENTREGAS"
   Exit Sub
End If
 
    Dim wsDB As Worksheet, wsLoad As Worksheet, wbLoad As Workbook
    Dim rngLoad As Range, rngDB As Range
    Dim i As Integer, bFound As Boolean
    Dim lRowSt As Long, lRowEnd As Long
    
    Const DBname = "DATA-BASE.XLS", DBLoad = "LOAD.XLS"
    
    'save ref to Database Worksheet
    Set wsDB = ActiveSheet
    
    'test to see if LOAD is available
    bFound = False
    For i = 1 To Workbooks.Count
        If UCase(Workbooks(i).Name) = DBLoad Then
            'found
            bFound = True
            Set wbLoad = Workbooks(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "EL LIBRO DE ENTREGAS NO ESTA ABIERTO, DEBE ABRIRLO ANTES DE REALIZAR ESTA ACCION", vbCritical, "Error"
        Exit Sub
    End If
    
    For i = 1 To wbLoad.Sheets.Count
        If wbLoad.Sheets(i).Name = wsDB.Name Then
            bFound = True
            Set wsLoad = wbLoad.Sheets(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "Matching worksheet not found in Load. Create before continuing", vbCritical, "Error"
        Exit Sub
    End If
    
    'determoine the output area
    Set rngLoad = wsLoad.Cells(wsLoad.Rows.Count, "A").End(xlUp).Offset(1, 0)
 
      'now find the input
    lRowSt = 0: i = 1
    wsDB.Range("A11").Activate
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.EntireRow.Hidden = True
        'finf the first visible row
        ActiveCell.Offset(1, 0).Activate
    Loop
    If ActiveCell.Value <> "" Then
        'ie not empty
         lRowSt = ActiveCell.Row
    End If
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.Value <> ""
        'find the last visible row
        If ActiveCell.EntireRow.Hidden = False Then
            lRowEnd = ActiveCell.Row
        End If
        ActiveCell.Offset(1, 0).Activate
    Loop
    If lRowEnd = 0 Then lRowEnd = lRowSt
    'now we can do the copy
    wsLoad.Unprotect
    
    wsDB.Range("A" & lRowSt, "A" & lRowEnd).Copy
    rngLoad.Offset(0, 0).PasteSpecial xlPasteValues
    
    wsDB.Range("D" & lRowSt, "D" & lRowEnd).Copy
    rngLoad.Offset(0, 1).PasteSpecial xlPasteValues
    
    wsDB.Range("L" & lRowSt, "L" & lRowEnd).Copy
    rngLoad.Offset(0, 11).PasteSpecial xlPasteValues
    
    wsDB.Range("M" & lRowSt, "M" & lRowEnd).Copy
    rngLoad.Offset(0, 12).PasteSpecial xlPasteValues
    
    wsDB.Range("O" & lRowSt, "O" & lRowEnd).Copy
    rngLoad.Offset(0, 13).PasteSpecial xlPasteValues
    
    wsDB.Range("P" & lRowSt, "P" & lRowEnd).Copy
    rngLoad.Offset(0, 14).PasteSpecial xlPasteValues
    
    wsDB.Range("K" & lRowSt, "K" & lRowEnd).Copy
    rngLoad.Offset(0, 15).PasteSpecial xlPasteValues
    
    wsLoad.Activate
    ix = Selection.Rows.Count
    'now need to merge cells'
    rngLoad.Offset(0, 0).Select
    Application.DisplayAlerts = False 'turn off prompt'
    
    For iy = 2 To 11   'the columns B-K'
        wsLoad.Range(rngLoad.Cells(1, iy), rngLoad.Cells(ix, iy)).Merge (False)
    Next iy
    
    Application.DisplayAlerts = False 'turn on prompt'
    
    'now format output zone'
    iy = 18 'ie column R'
    wsLoad.Range(rngLoad.Cells(1, 1), rngLoad.Cells(ix, iy)).Select
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
       If ix = 1 Then
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        Else
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End If
    End With
     
    rngLoad.Offset(0, 0).Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowInsertingRows:=True, AllowDeletingRows:=True, AllowFiltering:=True
    
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:

Select allOpen in new window

 

by: PabilioPosted on 2009-11-05 at 11:48:57ID: 25753183

Saraubh,

I dont´know Why I keep saying column D... IS COLUMN C in LOAD.xls ...sorry...the one that should not be merged and paste there the values that the code should ask (if possible).

I'm putting the donkey hat on me right now.

R.

 

by: saurabh726Posted on 2009-11-05 at 12:01:49ID: 25753318

Roberto,

Help me understand one thing, If i run your code in the enclosed filter in the databasefile it copies value in the load file and merge first row value to all the rows where the names are different that is i see row-c7 values  in the enitre c merge data that is "MARTHA BELLO", Isnt that incorrect since the names are different, I then checked your code and that is what it is set to do in the merge part. Help me understand am i missing something here.

Enclosed both the files for your reference.

Saurabh...

 

by: PabilioPosted on 2009-11-05 at 12:05:20ID: 25753354

Ok...
in order to run the code in the right way, The data in DATA BASE.xls must be filtered BY CUSTOMER (Column D) ... That's why I keep saying Column D all the time...
Do it that way and you'll see that the code has sense in what is doing.
Thank you for your time.
Roberto.

 

by: saurabh726Posted on 2009-11-05 at 12:20:54ID: 25753513

There you go use this code and now you apply filter it will show value as well.

Saurabh...

Private Sub CommandButton1_Click()
 
    If Not ActiveSheet.FilterMode Then
        MsgBox "DEBE FILTRAR POR CLIENTE ANTES DE PROCEDER A ENVIAR LA INFORMACION AL CUADERNO DE ENTREGAS"
        Exit Sub
    End If
 
    Dim wsDB As Worksheet, wsLoad As Worksheet, wbLoad As Workbook
    Dim rngLoad As Range, rngDB As Range
    Dim i As Integer, bFound As Boolean
    Dim lRowSt As Long, lRowEnd As Long
 
    Const DBname = "DATA-BASE.XLS", DBLoad = "LOAD.XLS"
 
    'save ref to Database Worksheet
    Set wsDB = ActiveSheet
 
    'test to see if LOAD is available
    bFound = False
    For i = 1 To Workbooks.Count
        If UCase(Workbooks(i).Name) = DBLoad Then
            'found
            bFound = True
            Set wbLoad = Workbooks(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "EL LIBRO DE ENTREGAS NO ESTA ABIERTO, DEBE ABRIRLO ANTES DE REALIZAR ESTA ACCION", vbCritical, "Error"
        Exit Sub
    End If
 
    For i = 1 To wbLoad.Sheets.Count
        If wbLoad.Sheets(i).Name = wsDB.Name Then
            bFound = True
            Set wsLoad = wbLoad.Sheets(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "Matching worksheet not found in Load. Create before continuing", vbCritical, "Error"
        Exit Sub
    End If
 
    'determoine the output area
    Set rngLoad = wsLoad.Cells(wsLoad.Rows.Count, "A").End(xlUp).Offset(1, 0)
 
    'now find the input
    lRowSt = 0: i = 1
    wsDB.Range("A11").Activate
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.EntireRow.Hidden = True
        'finf the first visible row
        ActiveCell.Offset(1, 0).Activate
    Loop
    If ActiveCell.Value <> "" Then
        'ie not empty
        lRowSt = ActiveCell.Row
    End If
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.Value <> ""
        'find the last visible row
        If ActiveCell.EntireRow.Hidden = False Then
            lRowEnd = ActiveCell.Row
        End If
        ActiveCell.Offset(1, 0).Activate
    Loop
    If lRowEnd = 0 Then lRowEnd = lRowSt
    'now we can do the copy
    wsLoad.Unprotect
 
    wsDB.Range("A" & lRowSt, "A" & lRowEnd).Copy
    rngLoad.Offset(0, 0).PasteSpecial xlPasteValues
 
    wsDB.Range("D" & lRowSt, "D" & lRowEnd).Copy
    rngLoad.Offset(0, 1).PasteSpecial xlPasteValues
 
    wsDB.Range("L" & lRowSt, "L" & lRowEnd).Copy
    rngLoad.Offset(0, 11).PasteSpecial xlPasteValues
 
    wsDB.Range("M" & lRowSt, "M" & lRowEnd).Copy
    rngLoad.Offset(0, 12).PasteSpecial xlPasteValues
 
    wsDB.Range("O" & lRowSt, "O" & lRowEnd).Copy
    rngLoad.Offset(0, 13).PasteSpecial xlPasteValues
 
    wsDB.Range("P" & lRowSt, "P" & lRowEnd).Copy
    rngLoad.Offset(0, 14).PasteSpecial xlPasteValues
 
    wsDB.Range("K" & lRowSt, "K" & lRowEnd).Copy
    rngLoad.Offset(0, 15).PasteSpecial xlPasteValues
 
    wsLoad.Activate
    ix = Selection.Rows.Count
    'now need to merge cells'
    rngLoad.Offset(0, 0).Select
    Application.DisplayAlerts = False    'turn off prompt'
 
 
    Dim srow As Long, lrow As Long, v As Long, c As Long
    srow = 7
    lrow = wsLoad.Cells(Cells.Rows.Count, "b").End(xlUp).Row
 
    Do Until srow > lrow
        If wsLoad.Cells(srow, "B") = wsLoad.Cells(srow + 1, "B").Value Then
            c = srow
            Do Until wsLoad.Cells(srow, "B").Value <> wsLoad.Cells(srow + 1, "B").Value
                srow = srow + 1
            Loop
            For iy = 2 To 11   'the columns B-K'
                wsLoad.Range(Cells(c, iy).Address & ":" & Cells(srow, iy).Address).Merge (False)
            Next iy
            srow = srow + 1
        Else
            srow = srow + 1
        End If
    Loop
 
    Application.DisplayAlerts = False    'turn on prompt'
 
    'now format output zone'
    iy = 18    'ie column R'
    wsLoad.Range(rngLoad.Cells(1, 1), rngLoad.Cells(ix, iy)).Select
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        If ix = 1 Then
            Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        Else
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
        End If
    End With
 
    rngLoad.Offset(0, 0).Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
                      , AllowInsertingRows:=True, AllowDeletingRows:=True, AllowFiltering:=True
 
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:

Select allOpen in new window

 

by: PabilioPosted on 2009-11-05 at 12:25:58ID: 25753579

Saraubh,

If is possible to mantain the merged celld for columns D to K in file LOAD.xls after the code runs it will be excellent due that there goes information for the complete order and affect all products for the customer...no need to repeated or filter by those columns.

Only column C in LOAD.xls is the column to avoid the merging of cells and paste there the Date asked when running the code...

R.

 

by: saurabh726Posted on 2009-11-05 at 12:30:50ID: 25753641

Roberto,

Thats what the code does it merges the cell and you still be able to apply filter over it.I'm still merging all your columns that is B to K.

Saurabh...

 

by: PabilioPosted on 2009-11-05 at 12:55:04ID: 25753904

Saraubh,

The last was a message I sent prior to receive yours...after I hit send your message with the code arrived.

I'm triying the code you sent... now it show always the value in column C when the data is filtered by other columns.

But (sorry for this but) ... when I filter by column C, which is the column that I need the data be filtered (by date ...there only will be values dd/mm/yyyy) then it only shows one row per order....when I need to show all rows from the order.

What do you think of what I told you before, that probably the solution could goes not merging column C cells and pasting there the value repeated in all cells (a date asked by the code when triggered?)....

R.

 

by: saurabh726Posted on 2009-11-05 at 12:59:02ID: 25753947

I'm lost here because here is the sample file after i run the code revised on which i gave to you...Is this what you want?? If not then can show me a sample of what you are looking for...

Saurabh...

 

by: PabilioPosted on 2009-11-05 at 13:39:03ID: 25754331

Saraubh,

Please see the file attached. (There are two comments that probably will explain better)

The problem is in COLUMN "C"... there goes only date...the delivery date which is manually filled after the code runs.

I filled some cells.... please See what happens when you filter the data in column C (Where the Yellow Tag is)....
i.e. Customer Luis Mariano Rodriguez... his order goes from row 8 to 25... after filtering in cell C6 by DATE (filter by 06/11/2009) there only will be 1 row of his order showed (row nº 8)

After the code runs (triggered in DATA BASE), there are some columns (Bto K) in LOAD.xls that have to be manually filled with some information or values... the cells that MUST be filled have conditional formatting to go RED untill the user fill the value.

PLease see my comment on cell C32 to C42 (highligted in blue) ...this is what I think is the possible solution.

Thank you for your patience.
Roberto.



 

by: saurabh726Posted on 2009-11-05 at 13:51:50ID: 25754452

Roberto,

One last query, if i understand correctly, your current code dont copy the dates so you want me to modify the code to copy the dates in C column instead of what its doing right now...?

Saurabh....

 

by: PabilioPosted on 2009-11-05 at 14:16:20ID: 25754669

Saraubh,

You are right...

The code does not copy the date in column C, it merge the cells without any value in it...this value We must filled manually....and the date that goes there is not always the same (today or tomorrow...it could be any date from today till weeks in the future, so it can't be filled trough a formula in VBA).

When We press the command button We already know the Date of delivery, but it must be filled manually due that it depends on the customer's agenda....that's why I suggest to use an Imput box to fill the values in column C when We trigger the command button in DATA BASE.xls.

This Spreadsheet filtered by the next day in column C is Our Loading Order to our warehouse...so it must show all rows from the same customer... not only the first.

I think that due the filtering problem , (when filtering by column C only shows 1 row), the code should paste the date in all cells in column C and without merging the cells.

Roberto.

 

by: saurabh726Posted on 2009-11-05 at 15:47:58ID: 25755392

So you are saying that if there are 90 filters like in this case, You can 90 times inputbox..???

Saurabh...

 

by: PabilioPosted on 2009-11-05 at 16:54:40ID: 25755804

No...  I'm not crazy my friend.   :-)

I'm talking to add some lines to the code that is triggered when you press the command button in DATA BASE.xls (The button that you press in DATA BASE.xls that actually does the copy, paste and merge the cells in LOAD.xls)

When you press command button in DATA BASE.xls, It is supposed you have previously filtered the data by customer ...so the actual code of that button should copy around three to eight rows (maybe more but is not normal), each time is pressed.
(The actual code could copy cells from a single row if the order Nº only has one row)

At the moment when you press command button in DATA BASE.xls (not command button in LOAD.xls)... it is possible to take the value that you fill in the imput box once and paste it in column C in LOAD.xls as many cells as rows have the customer's order the code is doing the copy-paste?. (Not in ALL cells in column C...just the rows that is pasting when is triggered).

So when you filtered DATA BASE by a different customer then you can write a different date in the imput box and that date will be pasted only in the rows that the code is pasting at that moment....

I hope this time I could explain better...

Regards,
Roberto.

 

by: saurabh726Posted on 2009-11-05 at 16:59:20ID: 25755829

No way i meant you are crazy, I'm just trying to understand what you are trying to do so that i can help you in best possible manner and thats what my aim is.

See i agree most of the times its one or two, But the filter which i applied has 90 entries of the same date, and thats what i meant.. in this case you get inputbox 90 times.

Now if you are looking for applying filter by names and then doing copying then it can be a different case since there will be less entries to copy for.

Once i have your clarity i will do that and this is what im going to do change in your code...

With every entry, You will get a msgbox asking to fill the date and whatever date you fill it will get pasted in column -c and apart then column-C, Column B TO k will still get merge but just column-c will be left out.

 

by: PabilioPosted on 2009-11-05 at 17:16:44ID: 25755926

I'm just kidding Saraubh...I really appreciatte your time and patience.


I think that the problem could be that you are filtering by date in DATA BASE ? (column B or C?)...

The filtering in DATA BASE.xls MUST be made ONLY by CUSTOMER (Column D)....if you filter by other column the code will work but the results in Load.xls will be wrong. (The code actually stops if the data is not filtered...but the real limit should be to stop if the data is not filtered by Customer (Column D).

Maybe this example could help....

We work with this files like this:

i.e. I call my customer Mr John... prevously I filtered DATA BASE.xls by Customer (Column D) and select Mr. John and the rows showed are 4.
Talking with Mr John We agreed to deliver his order in two days (08/11/2009).... that's the value that I will write in the imput box....

If instead of merge cells in column C in load.xls (as the codes does now)  you can achieve that the code does not merge that columns and repeat the value that I wrote in the imput box in each cell in column C in Load.xls I think We got it.

Roberto.

 

by: saurabh726Posted on 2009-11-05 at 17:19:45ID: 25755934

Okay so for some strange reason, Im not able to download your files now and im working from Home so dont have access to those files which i uploaded earlier, so can you please upload them again on...

www.ee-stuff.com

Also one last query now assuming there are two entires for the same name so you want two times inputbox or just one time inputbox in which the date you enter fills both the date column for both the entries.?

Saurabh...

 

by: PabilioPosted on 2009-11-05 at 17:42:03ID: 25756029

Saurabh,

If there are two entries for the same name, it will work with a single imput box due that always the different orders from a customer are loaded the same date.
If any product will not be delivered that date for any reason, I just hide the row in DATA BASE.xls before press the buttom and the code will not copy-paste those hiden values.

I already uploaded the files where you told me...anyway I'm uploading them here as well.

Thanks again for your help.
Roberto.

  • LOAD.xls
    • 73 KB

    THIS IS THE TARGET FILE

  • DATA-BASE.xls
    • 605 KB

    FILTER HERE BY COLUMN D (CUSTOMER) PRIOR TO RUN THE CODE.

 

by: saurabh726Posted on 2009-11-05 at 17:43:40ID: 25756034

Roberto,

Try downloading the files that you uploaded, You wont be able to do that since right now there is some problem in EE, thats the reason i asked you to upload on the following link:-

www.ee-stuff.com

Saurabh...

 

by: PabilioPosted on 2009-11-06 at 00:30:06ID: 25757523

Hi Saraubh,

When I read your last post I uploaded the files at www.ee-stuff.com.

It ask me by the url of my question...I paste there the URL and uploaded the two files....

Regards,
Roberto.

 

by: saurabh726Posted on 2009-11-06 at 07:03:56ID: 25759661

Okay, Use the following code...

Saurabh...

Private Sub CommandButton1_Click()
 
    If Not ActiveSheet.FilterMode Then
        MsgBox "DEBE FILTRAR POR CLIENTE ANTES DE PROCEDER A ENVIAR LA INFORMACION AL CUADERNO DE ENTREGAS"
        Exit Sub
    End If
 
    Dim wsDB As Worksheet, wsLoad As Worksheet, wbLoad As Workbook
    Dim rngLoad As Range, rngDB As Range
    Dim i As Integer, bFound As Boolean
    Dim lRowSt As Long, lRowEnd As Long
 
    Const DBname = "DATA-BASE.XLS", DBLoad = "LOAD.XLS"
 
    'save ref to Database Worksheet
    Set wsDB = ActiveSheet
 
    'test to see if LOAD is available
    bFound = False
    For i = 1 To Workbooks.Count
        If UCase(Workbooks(i).Name) = DBLoad Then
            'found
            bFound = True
            Set wbLoad = Workbooks(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "EL LIBRO DE ENTREGAS NO ESTA ABIERTO, DEBE ABRIRLO ANTES DE REALIZAR ESTA ACCION", vbCritical, "Error"
        Exit Sub
    End If
 
    For i = 1 To wbLoad.Sheets.Count
        If wbLoad.Sheets(i).Name = wsDB.Name Then
            bFound = True
            Set wsLoad = wbLoad.Sheets(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "Matching worksheet not found in Load. Create before continuing", vbCritical, "Error"
        Exit Sub
    End If
 
    'determoine the output area
    Set rngLoad = wsLoad.Cells(wsLoad.Rows.Count, "A").End(xlUp).Offset(1, 0)
 
    'now find the input
    lRowSt = 0: i = 1
    wsDB.Range("A11").Activate
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.EntireRow.Hidden = True
        'finf the first visible row
        ActiveCell.Offset(1, 0).Activate
    Loop
    If ActiveCell.Value <> "" Then
        'ie not empty
        lRowSt = ActiveCell.Row
    End If
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.Value <> ""
        'find the last visible row
        If ActiveCell.EntireRow.Hidden = False Then
            lRowEnd = ActiveCell.Row
        End If
        ActiveCell.Offset(1, 0).Activate
    Loop
    If lRowEnd = 0 Then lRowEnd = lRowSt
    'now we can do the copy
    wsLoad.Unprotect
 
    wsDB.Range("A" & lRowSt, "A" & lRowEnd).Copy
    rngLoad.Offset(0, 0).PasteSpecial xlPasteValues
 
    wsDB.Range("D" & lRowSt, "D" & lRowEnd).Copy
    rngLoad.Offset(0, 1).PasteSpecial xlPasteValues
 
    wsDB.Range("L" & lRowSt, "L" & lRowEnd).Copy
    rngLoad.Offset(0, 11).PasteSpecial xlPasteValues
 
    wsDB.Range("M" & lRowSt, "M" & lRowEnd).Copy
    rngLoad.Offset(0, 12).PasteSpecial xlPasteValues
 
    wsDB.Range("O" & lRowSt, "O" & lRowEnd).Copy
    rngLoad.Offset(0, 13).PasteSpecial xlPasteValues
 
    wsDB.Range("P" & lRowSt, "P" & lRowEnd).Copy
    rngLoad.Offset(0, 14).PasteSpecial xlPasteValues
 
    wsDB.Range("K" & lRowSt, "K" & lRowEnd).Copy
    rngLoad.Offset(0, 15).PasteSpecial xlPasteValues
 
    wsLoad.Activate
    ix = Selection.Rows.Count
    'now need to merge cells'
    rngLoad.Offset(0, 0).Select
    Application.DisplayAlerts = False    'turn off prompt'
 
 
    Dim srow As Long, lrow As Long, v As Long, c As Long
    Dim response As Date
    srow = 7
    lrow = wsLoad.Cells(Cells.Rows.Count, "b").End(xlUp).Row
 
 Do Until srow > lrow
 If wsLoad.Cells(srow, "C").Value = wsLoad.Cells(srow - 1, "C").Value Then
 wsLoad.Cells(srow, "C").Value = response
 wsLoad.Cells(srow, "C").NumberFormat = "mm/dd/yy"
 srow = srow + 1
 Else
 response = Application.InputBox("Please enter Delivery date for " & wsLoad.Cells(srow, "B").Value, "Enter Date", Type:=1)
 wsLoad.Cells(srow, "C").Value = response
  wsLoad.Cells(srow, "C").NumberFormat = "mm/dd/yy"
 srow = srow + 1
 End If
 Loop
 
 
 
 
    Do Until srow > lrow
        If wsLoad.Cells(srow, "B") = wsLoad.Cells(srow + 1, "B").Value Then
            c = srow
            Do Until wsLoad.Cells(srow, "B").Value <> wsLoad.Cells(srow + 1, "B").Value
                srow = srow + 1
            Loop
            For iy = 2 To 11   'the columns B-K'
            If iy <> 3 Then wsLoad.Range(Cells(c, iy).Address & ":" & Cells(srow, iy).Address).Merge (False)
            Next iy
            srow = srow + 1
        Else
            srow = srow + 1
        End If
    Loop
 
    Application.DisplayAlerts = False    'turn on prompt'
 
    'now format output zone'
    iy = 18    'ie column R'
    wsLoad.Range(rngLoad.Cells(1, 1), rngLoad.Cells(ix, iy)).Select
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        If ix = 1 Then
            Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        Else
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
        End If
    End With
 
    rngLoad.Offset(0, 0).Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
                      , AllowInsertingRows:=True, AllowDeletingRows:=True, AllowFiltering:=True
 
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:

Select allOpen in new window

 

by: PabilioPosted on 2009-11-06 at 07:36:27ID: 25759981

Hi Saraubh,

The code shows an imput box for each row that that the code is copiying and also shows an imput box for each row that already exists in Load.xls. (?)

Also the merge of cells of the same customer in columns B, D to K is lost....

It is possible to mantain the merging of cells in Columns B, D, E, F, G, H, I , J and K ?....and only to show a single Imput box which will copy the value entered there ONLY in cells of column C of the rows that are being copied from DATA BASE.xls at that time ?
(There is no need to change the values in column C that already are in load.xls).

If you are tired with this problem, I can understand it....just let me know, I'll grant you the points anyway and do the unmerging-filling manually.
I know this is taking more of your time than it should and I'm sorry.

Thank you again for your help.
Roberto.

 

by: saurabh726Posted on 2009-11-06 at 08:33:22ID: 25760587

Roberto,

There you go, Use the following code...

Saurabh...

Private Sub CommandButton1_Click()
 
    If Not ActiveSheet.FilterMode Then
        MsgBox "DEBE FILTRAR POR CLIENTE ANTES DE PROCEDER A ENVIAR LA INFORMACION AL CUADERNO DE ENTREGAS"
        Exit Sub
    End If
 
    Dim wsDB As Worksheet, wsLoad As Worksheet, wbLoad As Workbook
    Dim rngLoad As Range, rngDB As Range
    Dim i As Integer, bFound As Boolean
    Dim lRowSt As Long, lRowEnd As Long
 
    Const DBname = "DATA-BASE.XLS", DBLoad = "LOAD.XLS"
 
    'save ref to Database Worksheet
    Set wsDB = ActiveSheet
 
    'test to see if LOAD is available
    bFound = False
    For i = 1 To Workbooks.Count
        If UCase(Workbooks(i).Name) = DBLoad Then
            'found
            bFound = True
            Set wbLoad = Workbooks(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "EL LIBRO DE ENTREGAS NO ESTA ABIERTO, DEBE ABRIRLO ANTES DE REALIZAR ESTA ACCION", vbCritical, "Error"
        Exit Sub
    End If
 
    For i = 1 To wbLoad.Sheets.Count
        If wbLoad.Sheets(i).Name = wsDB.Name Then
            bFound = True
            Set wsLoad = wbLoad.Sheets(i)
            Exit For
        End If
    Next i
    If Not bFound Then
        MsgBox "Matching worksheet not found in Load. Create before continuing", vbCritical, "Error"
        Exit Sub
    End If
 
    'determoine the output area
    Set rngLoad = wsLoad.Cells(wsLoad.Rows.Count, "A").End(xlUp).Offset(1, 0)
 
    'now find the input
    lRowSt = 0: i = 1
    wsDB.Range("A11").Activate
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.EntireRow.Hidden = True
        'finf the first visible row
        ActiveCell.Offset(1, 0).Activate
    Loop
    If ActiveCell.Value <> "" Then
        'ie not empty
        lRowSt = ActiveCell.Row
    End If
    ActiveCell.Offset(1, 0).Activate
    Do While ActiveCell.Value <> ""
        'find the last visible row
        If ActiveCell.EntireRow.Hidden = False Then
            lRowEnd = ActiveCell.Row
        End If
        ActiveCell.Offset(1, 0).Activate
    Loop
    If lRowEnd = 0 Then lRowEnd = lRowSt
    'now we can do the copy
    wsLoad.Unprotect
 
    wsDB.Range("A" & lRowSt, "A" & lRowEnd).Copy
    rngLoad.Offset(0, 0).PasteSpecial xlPasteValues
 
    wsDB.Range("D" & lRowSt, "D" & lRowEnd).Copy
    rngLoad.Offset(0, 1).PasteSpecial xlPasteValues
 
    wsDB.Range("L" & lRowSt, "L" & lRowEnd).Copy
    rngLoad.Offset(0, 11).PasteSpecial xlPasteValues
 
    wsDB.Range("M" & lRowSt, "M" & lRowEnd).Copy
    rngLoad.Offset(0, 12).PasteSpecial xlPasteValues
 
    wsDB.Range("O" & lRowSt, "O" & lRowEnd).Copy
    rngLoad.Offset(0, 13).PasteSpecial xlPasteValues
 
    wsDB.Range("P" & lRowSt, "P" & lRowEnd).Copy
    rngLoad.Offset(0, 14).PasteSpecial xlPasteValues
 
    wsDB.Range("K" & lRowSt, "K" & lRowEnd).Copy
    rngLoad.Offset(0, 15).PasteSpecial xlPasteValues
 
    wsLoad.Activate
    ix = Selection.Rows.Count
    'now need to merge cells'
    rngLoad.Offset(0, 0).Select
    Application.DisplayAlerts = False    'turn off prompt'
 
 
    Dim srow As Long, lrow As Long, v As Long, c As Long
    Dim response As Date
    srow = rngLoad.Offset(0, 0).Row
    lrow = wsLoad.Cells(Cells.Rows.Count, "b").End(xlUp).Row
 
 Do Until srow > lrow
 If wsLoad.Cells(srow, "b").Value = wsLoad.Cells(srow - 1, "b").Value Then
 wsLoad.Cells(srow, "C").Value = response
 wsLoad.Cells(srow, "C").NumberFormat = "mm/dd/yy"
 srow = srow + 1
 Else
 response = Application.InputBox("Please enter Delivery date for " & wsLoad.Cells(srow, "B").Value, "Enter Date", Type:=1)
 wsLoad.Cells(srow, "C").Value = response
  wsLoad.Cells(srow, "C").NumberFormat = "mm/dd/yy"
 srow = srow + 1
 End If
 Loop
 
 
 srow = rngLoad.Offset(0, 0).Row
 
    Do Until srow > lrow
        If wsLoad.Cells(srow, "B") = wsLoad.Cells(srow + 1, "B").Value Then
            c = srow
            Do Until wsLoad.Cells(srow, "B").Value <> wsLoad.Cells(srow + 1, "B").Value
                srow = srow + 1
            Loop
            For iy = 2 To 11   'the columns B-K'
            If iy <> 3 Then wsLoad.Range(Cells(c, iy).Address & ":" & Cells(srow, iy).Address).Merge (False)
            Next iy
            srow = srow + 1
        Else
            srow = srow + 1
        End If
    Loop
 
    Application.DisplayAlerts = False    'turn on prompt'
 
    'now format output zone'
    iy = 18    'ie column R'
    wsLoad.Range(rngLoad.Cells(1, 1), rngLoad.Cells(ix, iy)).Select
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        If ix = 1 Then
            Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        Else
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
        End If
    End With
 
    rngLoad.Offset(0, 0).Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
                      , AllowInsertingRows:=True, AllowDeletingRows:=True, AllowFiltering:=True
 
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:

Select allOpen in new window

 

by: PabilioPosted on 2009-11-06 at 09:12:00ID: 25760987

SARAUBH,

YOU ARE GREAT !!!!!

Excellent my friend...better than in my sweetest dream.

God bless you my friend... for your brains, your patience and your good will.

Thank you very very very much for being there untill the end.

Best regards,
Roberto.

 

by: PabilioPosted on 2009-11-06 at 09:12:23ID: 31650639

I wish I could grant you more than 500....

 

by: saurabh726Posted on 2009-11-06 at 09:14:44ID: 25761005

Roberto,

Thanks for the compliment, i took long to understand your requirement but finally im glad that we have something which caters to your need and does what you are looking for..

Saurabh...

 

by: PabilioPosted on 2009-11-06 at 09:43:44ID: 25761223

Saurabh,

If you want to, please chek this question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_24878693.html
Is just a little make up for the code you fixed.

Regards,
Roberto.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...