An inhomogeneous system is studied consisting of a hard sphere fluid and a microporous slitlike membrane. The structure of the membrane is generated by filling a slit by randomly centred spheres and by subsequent quench. The membrane is set at the centre of a slit-like pore with hard impenetrable walls. The pore is wide enough for there to be a ‘bulk’ state of a fluid between the pore wall and the membrane boundary. We investigate the equilibrium between a fluid and a single membrane, and also between a fluid and two separated membranes. This model is studied using the inhomogeneous replica Ornstein—Zernike equations with the Born—Green—Yvon equation and the inhomogeneous Percus—Yevick closure and by Monte Carlo simulations. The density profile outside and inside the membrane are calculated and their dependence on the density of membrane species, on the chemical potential of the fluid, and on the distance between two membranes are discussed. A comparison of the simulation data with theoretical predictions shows that the proposed theory successfully describes the fluid structure in the investigated systems. There is a decreasing density to the centre of the microporous membrane body and layers of fluid species are formed between two separated random matrix membranes.