Results 1 to 9 of 9

vba script to calculate data across multiple columns

Threaded View

  1. #1
    Registered User
    Join Date
    06-27-2017
    Location
    London
    MS-Off Ver
    2013
    Posts
    2

    vba script to calculate data across multiple columns

    Hi all,

    i have a rather large data sheet that i need to perform a calculation on by a fixed amount per column

    i have around 300 columns of data, with around 600 rows, i have written this script which performs the calculation on a single column of data, but need to expand it to cover all columns of data

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    Dim LastRow As Long
    Dim i As Long
    LastRow = 111
        For i = 3 To LastRow
          Range("D" & i).Value = Range("D" & i).Value / Range("D1").Value
        Next i
    '
    End Sub

    here is a sample of my dataset

    4.7239 4.7239 4.7239 2.3021
    COmpany1 Company2 Company3 Company4
    -203222 300000 2000000 -4443322
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    0 0 0 0
    Last edited by pchappo; 07-14-2017 at 02:39 AM. Reason: added tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA script to open multiple links from a couple of columns in a spreadsheet
    By mss90 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2016, 02:04 AM
  2. Replies: 7
    Last Post: 02-19-2016, 03:50 PM
  3. [SOLVED] Calculate NETWORKDAYS from multiple columns and return NA if columns not populated yet
    By Cdavies in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-16-2014, 10:51 AM
  4. Calculate period between multiple dates _VBA script
    By raw_geek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2014, 08:03 AM
  5. Combine multiple cells in columns - Concat with variable spacing using VBA Script
    By AMC_CO in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2013, 03:57 PM
  6. Macro/Script for Moving Groups of Data in to Separate Columns
    By JustinSxcel in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 07-05-2012, 01:56 AM
  7. script to split 4 columns of data into 12
    By madunlop in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-24-2009, 09:39 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