Results 1 to 9 of 9

VBA Efficiency

Threaded View

  1. #1
    Registered User
    Join Date
    03-19-2022
    Location
    Columbus, Ohio
    MS-Off Ver
    2011 For Mac
    Posts
    2

    VBA Efficiency

    Howdy all! Running 2011 Excel on my 2012 MacBook Pro. Just learning how to use excel passed inputting numbers in someone else's sheet. In making my own sheet, to keep it clean, I hid blank rows, but wanted another blank row to appear, when needed. After asking a few people who don't know VBA, who said there isn't a way, I wrote my own way. I understand it may 100% just be my computer(yes I know I could buy a $50 PC that would be better), but this code takes about 6 seconds to work. Just wondering if there would have been a more efficient way of writing this out? Perhaps making a range within the column, instead of the entire column?
    TIA!
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 2 Then
    Application.EnableEvents = True
    Hiderows
    StartRow = 7
    EndRow = 43
    ColNum = 2
    For i = StartRow To EndRow
    If Cells(i, ColNum).Value = "" Then
    Cells(i + 1, ColNum).EntireRow.Hidden = True
    Else
    Cells(i + 1, ColNum).EntireRow.Hidden = False
    End If
    Next i
    End If
    End Sub
    Last edited by Homesteader82; 03-19-2022 at 06:06 PM. Reason: Typo

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help improving Job efficiency
    By popovgor in forum Excel General
    Replies: 5
    Last Post: 03-07-2014, 01:11 PM
  2. Efficiency Cumullative
    By Anuru in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2013, 10:30 AM
  3. Efficiency Tracker
    By villivonka in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2013, 05:32 AM
  4. Macro Efficiency?
    By wz4np1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2010, 07:15 PM
  5. Code efficiency
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-27-2010, 06:56 PM
  6. Efficiency
    By gtmeloney in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2009, 11:10 AM
  7. Efficiency… Efficiency… Efficiency…
    By rakeshplb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2009, 08:37 AM
  8. Efficiency using IF and OR
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-30-2009, 08:27 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