Results 1 to 5 of 5

with statement

Threaded View

Blake 7 with statement 02-27-2014, 04:35 PM
alansidman Re: with statement 02-27-2014, 04:47 PM
6StringJazzer Re: with statement 02-27-2014, 04:50 PM
Kaper Re: with statement 02-27-2014, 04:52 PM
Blake 7 Re: with statement 02-27-2014, 05:03 PM
  1. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: with statement

    may be try:
    Sub dRILLDOWN()
    call realdRILLDOWN("Drill Down")
    call realdRILLDOWN("Forecast")
    end sub
    
    
    Sub realdRILLDOWN(mysheet as string)
     Dim x, i As Long, y, ii&, j&, k&
    Application.ScreenUpdating = 0
      With Worksheets("Drill Down") 'may be here  With Worksheets(mysheet)
        y = .Range("F8:S" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
    End With
     With Worksheets("Source Data")
        x = .Range("A1:B" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
    End With
     
    With Worksheets(mysheet)
     ' the rest
    edit: almost the same way ;-) but as always slightly different way to skin the cat.
    Notice other type of argument, other way to call procedure with argument and my doubts about serching for value of y - shall it be always taken from Drill Down sheet? Can imagine that it shall do this way. Or shall it be determined as other value for Forecatst sheet - also pausible.
    Last edited by Kaper; 02-27-2014 at 04:56 PM.
    Best Regards,

    Kaper

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If statement that will look among multiple criteria and generate a statement
    By liz5818 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2013, 04:12 PM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1