Macro to hide cells based on contents in previous tab

claireegloff

New Member
Joined
Jan 13, 2015
Messages
2
Hi there

I have a spreadsheet where users can enter details of multiple clients and it will pre-populate forms based on the number of clients entered.

I only want 3 forms to be pre-popped if 3 clients are entered, 30 if 30 are and so on.

I want a macro that says if a cell in column A of tab 1 contains data, populate a form on tab 2 for that client.

Is this possible?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hello,

To begin with you need a check macro - something like :
Code:
Option Explicit
Public Sub foo()
    Dim rngSpare    As Excel.Range
    Set rngSpare = Sheet1.Range("A1")
    If Not rngSpare.Value = "" Then
        Debug.Print rngSpare.Value
    End If
End Sub

If your cell is A1 and it is empty debug.print will run - you can replace this with your next copy paste macro. I suggest recording a macro copying and pasting exactly how you want it to and that will give you the basis for the code you will need to run if A1 or whichever cell it is has something in it.
 
Upvote 0
your subject is a bit confusing to the message.

1. You enter nth number of customer to a sheet
2. then you want to check how many entries have been done
3. you want to open then nth amount of Forms for each customer on separate sheets???
 
Upvote 0
True - I was only guessing.

Perhaps you could provide examples of the data flows?

Jake

your subject is a bit confusing to the message.

1. You enter nth number of customer to a sheet
2. then you want to check how many entries have been done
3. you want to open then nth amount of Forms for each customer on separate sheets???
 
Upvote 0
Sorry, it is a bit isn't it.

Tab 1 contains an empty table with 25 rows which the end user completes with details of their clients (not necessarily 25).

Tab 2 contains 25 empty forms (61 rows per form columns A:AE) with formulas in the relevant cells retrieving data from tab 1.

What I want to do is have a macro that will hide any forms that do not have a corresponding row in tab 1. So, if there are 5 clients, 20 forms are hidden, 20 client, 5 forms hidden and so on.

Apologies. My knowledge of macros and the language used is very basic.
 
Upvote 0

Forum statistics

Threads
1,215,151
Messages
6,123,321
Members
449,094
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top