Help Finishing A Macro To Insert Data Into A Column

gaspower

Board Regular
Joined
Jun 10, 2005
Messages
55
Hello,

I need some help to finish up a macro. The current macro I am using is,
Code:
Sub changeheaders()
    With Sheet1
    
    Columns("B:D").Select
Selection.Delete Shift:=xlToLeft

        .Cells(1, 1).Value = "v_products_model"
        .Cells(1, 2).Value = "v_products_quantity"
        .Cells(1, 3).Value = "EOREOR"
        
        
    End With
End Sub
which gets me to this point,
image1.JPG


I need to fill column "C" with EOREOR down to match last data in column "A",
image2.JPG


Thank you
JR
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hello,

Was able to fix with this macro,

Code:
Option Explicit

Sub changeheaders()
    With Sheet1
    
    Columns("B:D").Select
Selection.Delete Shift:=xlToLeft

        .Cells(1, 1).Value = "v_products_model"
        .Cells(1, 2).Value = "v_products_quantity"
        .Cells(1, 3).Value = "EOREOR"
        
        
      Dim LastRow As Long
    Range("C2").Value = "EOREOR"
    
      LastRow = Range("A1:A" & Range("A1").End(xlDown).Row).Rows.Count
Range("C2" & ":C" & LastRow).FillDown

        
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

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