VB.NET - code to unhide worksheets based on value in cell on another worksheet

Asked By Joseph
11-Feb-12 07:25 AM
Can you help me - what is the VBA to show/hide one worksheet based on a cell value in another worksheet? Or would it be easier to use conditional formatting?

e.g. Cell "H7"contains the week number of the period, i.e. 1,2,3,4,5. I need vba that will automatically show the appropriate weekly sales report and the inventory(inventory1, inventory2, etc) sheet for that week (if the value in"H7" =1 then show week 1 hiding weeks 2,3,4,5; if the value in"H7" =2 then show week 2 hiding weeks 1,3,4,5 etc )

I am using excel 2007, but need it to work w/2000 and 2003 as well.

Thanks.
  Leigh Thomas replied to Joseph
12-Feb-12 02:51 PM
Hi I think what you need is one excel book/sheet to contain all the data (in a database format) then use another book/sheet to filter it if you want it that seperate!!  You could use an IF formula to return the results you want based on conditions attached to those results
if you want to give more details on what exactly you want I could probably help more

hope this helps

leigh
Create New Account
help
Call a VB.Net App from an Excel Macro .NET Framework Dear Anyone: I am building a Report Writer. I need to call an VB.Net App from a Cell in an Excel sheet. For instance, Ctl-d would ball a VBA Macro in excel that would in turn call my vb.net app, provide the necessary info and return to the Excel sheet. How can this be Discussions Marshal.ReleaseComObject (1) Office (1) Excel (1) GemBox.Spreadsheet (1) ReleaseComObject (1) VSTO (1) VBA (1) VB (1) You'll need to register the VB .NET app. for COM InterOp
VB.NET Inserted Picture Ends Up in Wrong Cell Excel I have spent about 5 hours tonight trying to find out how to insert a picture into a cell using VB.NET. It turns out I was finding code which (ALMOST) works but Intellisense kept telling me the picture always ends up in row 4, column B. Note that this is not VBA. I am using VB.NET and an Interop Assembly (Microsoft Excel 12.0 Object Library / Imports Excel = Microsoft.Office.Interop Thanks, Bob Excel Programming Discussions Microsoft.Office.Interop.Excel (1) Microsoft Excel (1) Office (1) Worksheet (1) VB.NET (1) VBA (1) VB (1) ObjSheet.Pictures.insert (1) I do not
via Automation Add-in) Generates #V Excel Hello, I am converting a custom function from VBA to VB.net in Visual Studio 2005. I have included the source code from both the original VBA function, as well as my VB.net translation. I have reviewed various articles for correcting syntax related issues, and applied changes, but error thrown during deployment / installation. When I try to use the custom function in a worksheet, however, it always generates a #VALUE error. The VBA function never does this, and I have exhausted my resources towards solving this on my
Using excel solver in VB.NET .NET Framework Hi to all, I want to use the Excel solver in a VB.Net project. The macro Sub Makro1Solver() Application.Run "Solver.xla!Auto_Open" SolverReset Worksheets(1).Select Worksheets müssen sich in der aktiven Tabelle befinden." appears when I start the macro from my VB.NET project. My translation for the messages "Goalcell must be a single cell in an active Goalcells must locate in the active table". The function in the cell R9C2 is My VB.NET code is Dim ExApp As New Microsoft.Office.Interop.Excel.Application Dim wb As Microsoft
VB net Form write to Excel I'm very new to VB.net so please excuse me if I'm posting this in the wrong location. I'm and write that information to an excel file. I was able to do this in VBA but totally lost on what VB.net code looks like or is structured compared to VBA. So if anyone could post a very basic simple form with one or two combo