+ Reply to Thread
Results 1 to 2 of 2

Having an issue with variables across sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    24

    Having an issue with variables across sheets

    I spent the better part of the day trying to get this code to work. I was hoping someone could take a glance at it and point out what stupid mistake i've made.
    My main problem is, I want to use my variable as a column reference but cannot seem to get it into the correct format to accept it as a variable. I spent a large portion of my time trying to find a solution online and it seems like whats called RC is what people use but I cannot seem to follow that style very well.

    If I made a mistake posting this incorrectly or something to that nature, let me know and I will change it immediately. Sorry in advance I am new here

    
    
    Dim c
    
    
    
    
    C=1
    
    Sheets(“Series Formatted Data”).Select
    
    Do While Cells(1,c) <>””
    
    If Cells(1,C) =”MRP” Then
    
                   Sheets("Sheet1").Cells(2, 11).Formula = "= Average(‘Series Formatted Data’!C:C)"
    
    Elseif Cells(1,C) =” EC_Io” then
    
                   Sheets(“Sheet1”).Cell(2,12).Formula = “=Average(‘Series Formatted Data’!C:C)”
    
    Elseif Cells(1,C) = “MTP” Then
    
                   Sheets(“Sheet1).Cell(3,12).Formula = “=Average(‘Series Formatted Data’!C:C)”
    
    c=c+1
    loop
    I left out some of the other parts of the code since the part im really stuck on is making the C a variable not a column reference.
    Last edited by cosmicwinds; 06-28-2013 at 02:18 AM.

  2. #2
    Registered User
    Join Date
    06-27-2013
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Having an issue with variables across sheets

    Removed this since it was a useless post that added no value.
    Last edited by cosmicwinds; 06-28-2013 at 02:19 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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