+ Reply to Thread
Results 1 to 6 of 6

# VBA looping sheet by sheet with name sheet #

  1. #1
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,257

    Thumbs up # VBA looping sheet by sheet with name sheet #

    i want looping by sheetname = if left (ws.name,4) = "Week" star from sheets Week (1) to sheets(Week (6) )
    in every sheet week (1) to week (6) in A1.formula = in Week (1) = 25/12/2016 then in Week (2) = Week (1).range("A1") + 7 then in Week (3).range("A1") =Week (2).range("A1")+7
    until Week (6).range("A1") = Week (5).range("A1") + 7
    In Every sheet week (1) to week (6) in range(F3: F16 ).formula = B3 x D3
    how i can do with vba makro past makro
    ttt.png
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: # VBA looping sheet by sheet with name sheet #

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,257

    Re: # VBA looping sheet by sheet with name sheet #

    Screenshot_71.png
    alphaFrog : in F3 : F15 only result formula if cell not blank in b3:b15 how to do
    Last edited by daboho; 12-25-2016 at 06:36 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,257

    Re: # VBA looping sheet by sheet with name sheet #

    Thank you alphaFrog is great job

    Sub LoopingSheet()
    Dim Rng As Range
    Dim Lr As Long: Lr = Sheets("Week (1)").UsedRange.Rows.Count
    Dim i As Long
    Sheets("Week (1)").Range("A1").Value = Date
    For i = 1 To 6
    If i > 1 Then Sheets("Week (" & i & ")").Range("A1").Formula = "='Week (" & i - 1 & ")'!A1 + 7"
    With Sheets("Week (" & i & ")")
    Set Rng = .Range("b3:b" & Lr).SpecialCells(xlCellTypeConstants, xlNumbers)
    Rng.Offset(0, 4).Formula = "=b3 * d3"
    End With
    Next i
    End Sub

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: # VBA looping sheet by sheet with name sheet #

    You're welcome.

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,257

    Re: # VBA looping sheet by sheet with name sheet #

    thankyour very match
    Last edited by daboho; 12-25-2016 at 11:26 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Looping thru rows and copy cell values from "Inputs" sheet to "Output" sheet
    By hariexcel1987 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2015, 11:32 PM
  2. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  3. [SOLVED] Match Value in Sheet 1 with Sheet 2, copy entire row from sheet 1 to new sheet
    By lzyshaman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2013, 07:48 AM
  4. [SOLVED] find code# from sheet 1 on sheet 2, compare value on sheet 1 with value on sheet 2
    By BlakeLee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2013, 01:52 PM
  5. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  6. Looping through worksheets to copy/paste to new sheet - last sheet never copies
    By lifeboat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2011, 01:53 PM
  7. Replies: 2
    Last Post: 10-12-2010, 05:00 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