Results 1 to 3 of 3

Convert my code from one cell to a full range

Threaded View

  1. #1
    Registered User
    Join Date
    10-08-2020
    Location
    Palmyra, New Jersey
    MS-Off Ver
    Microsoft Office 2013
    Posts
    2

    Exclamation Convert my code from one cell to a full range

    Hello,

    I am brand new to VBA and have only gotten this far through some Google searches and a compilation of my research. The code below will work on my first row of data, but I need to expand the loop to work through all rows (my data runs Row 8 through Row 744). My spreadsheet is very busy, but the main columns of concern are BC and BE. Column BE = ( AW / (AZ + BC) ) where AW & AZ are values and I add one by one (1+1...) to BC until it brings BE to be < = 326.49. Again, the below code works for my data in Row 8, but how do I expand it so it does the same loop in BC9:BC744?


    Private Sub CommandButton1_Click()
    
        If Range("BE8").Value > 326.49 Then
            Range("BC8").Value = 1
        End If
        
        If Range("BE8").Value > 326.49 Then
        Do Until Range("BE8").Value < 326.49
            Range("BC8").Value = Range("BC8").Value + 1
        Loop
            
        End If
    
    End Sub
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    THANK YOU for consideration!
    Last edited by 6StringJazzer; 10-08-2020 at 08:07 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Perform search & return complete text out of a range but not the full cell content
    By aguilarpro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-25-2017, 02:43 PM
  2. Convert Cell Formula to Convert Text to VBA Code
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2014, 05:51 PM
  3. [SOLVED] need code that will convert a table to a range
    By RuthMP in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2014, 10:09 AM
  4. Use previous full cell in the subsequent empty cells in a range
    By 3hundred in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2013, 05:19 PM
  5. [SOLVED] Formula to Convert First/Last Name to 1st Letter of 1st Name + Full Last Name
    By jordan1214 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2013, 02:17 AM
  6. Define range to select from current cell in a full range (using worksheet_change)
    By draddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 11:48 AM
  7. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM

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