Results 1 to 9 of 9

Add Columns to Code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    1,009

    Add Columns to Code

    Hello,

    I would like to add columns 8 and 9 to the below code so that column 7 is not included. The line is ' For ApptCol = 4 To 6'

    Can this be done?

    The reason I want to do this is so the duration on the Schedule sheet is calculated from the start time to end time.

    Sub Appt_Load()
    With Schedule
        If .Range("B9").Value = Empty Then
            MsgBox "Please select a correct appointment"
            Exit Sub
        End If
        ApptRow = .Range("B9").Value
        .Range("E3").Value = Appts.Range("C" & ApptRow).Value 'Add in Contact Name
        For ApptCol = 4 To 6
            .Range("E" & ApptCol + 1).Value = Appts.Cells(ApptRow, ApptCol).Value 'Add in Appt Details
        Next ApptCol
    End With
    Schedule.Range("E3").Select
    End Sub
    Attached Files Attached Files
    Last edited by billy60; 03-22-2023 at 12:32 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need fix for VBA Code to Custom Sort multiple columns that includes DATE columns
    By Kirk3737 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2020, 02:35 PM
  2. VBA Code to copy values from two columns of a WS to two columns of another WS
    By Webz2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2019, 03:24 AM
  3. Need macro code to rearrange columns and to delete unwanted columns
    By Giri.hb in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-16-2019, 03:00 AM
  4. Replies: 3
    Last Post: 06-29-2016, 01:38 PM
  5. VBA code to hide filtered columns (simple table 5 rows / 6 columns wide)
    By e2010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2014, 02:41 PM
  6. [SOLVED] Use VBA code to insert 30 blank columns every 30 columns
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-02-2014, 11:02 PM
  7. Code selects entire rows upto one range and same code selects only columns for other.
    By sriharigk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2012, 05:19 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