  In this paper we have discussed the possibility of forming anisotropic
compact stars from cosmological constant as one of the competent candidates of
dark energy with cylindrical symmetry. For this purpose, we have applied the
analytical solution of Krori and Barua metric to a particular cylindrically
symmetric spacetime. The unknown constants in Krori and Barua metric have been
determined by using masses and radii of class of compact stars like
4$U$1820-30, Her X-1, SAX J 1808-3658. The properties of these stars have been
analyzed in detail. In this setting the cosmological constant has been taken as
a variable which depends on the radial coordinates. We have checked all the
regularity conditions, stability and surface redshift of the compact stars
4$U$1820-30, Her X-1, SAX J 1808-3658.
