Copy from column C:O of active cell

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,341
Office Version
  1. 365
Platform
  1. Windows
Is there a way to copy from column C through column O of active cell if there isn't more than one cell active?

Also they must be in row 11 or higher. If active cell isn't in row 11 column C or > then do nothing or message box that they are not in range...

My sheet name is "2 Select Bid Items" and the area is a table

Thanks for the help!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Solved

Code:
Sub Add_Vendor_Row()


    Dim sh As Worksheet
    Dim tblVendor As ListObject
    Dim Lastrow As ListRow
    Dim SCR As Variant
    Dim FND As Variant
    Dim LR As Long
    
    Set sh = Sheet3
    Set tblVendor = sh.ListObjects("Selected_Vendors")


If Intersect(ActiveCell, Range("C11:X50")) Is Nothing Then
    MsgBox "Out of range"
    Exit Sub
End If

Sheets("1 Select Vendors").Range("C" & ActiveCell.Row & ":" & "O" & ActiveCell.Row).Copy
Sheets("Selected Vendors List").Range("B5").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        
    Application.CutCopyMode = False

    SCR = Sheets("Selected Vendors List").Range("C5").Value
    FND = Application.Match(SCR, tblVendor.ListColumns("Name").DataBodyRange, 0)
    If IsError(FND) Then
        Set Lastrow = tblVendor.ListRows.Add
        Lastrow.Range.Value = Sheets("Selected Vendors List").Range("B5:Z5").Value
    End If
    
'*********************************
'Paste Vendor to 3 Quote Data
'*********************************

    Sheets("3 Enter Quote Data").Range("F5").Value = Sheets("Selected Vendors List").Range("C5").Value
    
'**********
'Name Range
'**********
    
    NamedRangeVendors
    
    Range("D8").Select
    
    
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top