+ Reply to Thread
Results 1 to 3 of 3

Divide values in different sheets by 1000, when each sheet have different number of rows

  1. #1
    Registered User
    Join Date
    05-01-2023
    Location
    Singapore
    MS-Off Ver
    (Version 2302 Build 16.0.16130.20378) 64-bit
    Posts
    66

    Divide values in different sheets by 1000, when each sheet have different number of rows

    Using the test sheet I uploaded as example: Test.xlsm

    Divide values in data sheet 1 and 2, which have different number of rows, by 1000.

    The 'Goal' sheet is just for illustration, the vba code should work the code in the actual data sheets itself.
    Last edited by webcam723; 07-20-2023 at 04:36 AM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Divide values in different sheets by 1000, when each sheet have different number of ro

    Try below code:

    PHP Code: 
    Option Explicit
    Sub divide
    ()
    Dim lCell As Rangews As Worksheetrng As Range
    For Each ws In Sheets
        
    If ws.Name "Data Sheet 1" Or ws.Name "Data Sheet 2" Then
            Set lCell 
    ws.Cells(Rows.Count"L").End(xlUp)
            
    Set rng ws.Range("E2"lCell)
            
    rng.Value Evaluate("='" ws.Name "'!" rng.Address "/ 1000")
        
    End If
    Next
    End Sub 
    Quang PT

  3. #3
    Registered User
    Join Date
    05-01-2023
    Location
    Singapore
    MS-Off Ver
    (Version 2302 Build 16.0.16130.20378) 64-bit
    Posts
    66

    Re: Divide values in different sheets by 1000, when each sheet have different number of ro

    This works perfectly. Thank you for ur help!

+ 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. Replies: 1
    Last Post: 05-27-2015, 08:13 AM
  2. [SOLVED] Change format into a Europe Number Format and divide with 1000
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2015, 05:26 AM
  3. [SOLVED] formatting to divide by 1000
    By ammartino44 in forum Excel General
    Replies: 3
    Last Post: 05-07-2014, 07:38 PM
  4. [SOLVED] Split large sheet in multiple 1000 row sheets
    By thotosch in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 06:29 AM
  5. Divide a range by 1000
    By 1heng in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-29-2007, 01:21 PM
  6. Divide selected cells by 1000
    By Lowkey in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2006, 06:45 PM
  7. In sheet of 1000+ rows how do I go to last?
    By parvenu in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-06-2006, 10:10 AM

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