Excel Macro to find last cell in Sheet
Closed
DCecil07
Posts
30
Registration date
Monday March 15, 2010
Status
Member
Last seen
September 15, 2010
-
Aug 26, 2010 at 01:00 PM
DCecil07 Posts 30 Registration date Monday March 15, 2010 Status Member Last seen September 15, 2010 - Aug 30, 2010 at 07:46 AM
DCecil07 Posts 30 Registration date Monday March 15, 2010 Status Member Last seen September 15, 2010 - Aug 30, 2010 at 07:46 AM
Related:
- Excel Macro to find last cell in Sheet
- Mark sheet in excel - Guide
- How to open excel sheet in notepad++ - Guide
- Sheet right to left in google sheet - Guide
- Excel macro to create new sheet based on value in cells - Guide
- How to screenshot excel sheet - Guide
4 responses
DCecil07
Posts
30
Registration date
Monday March 15, 2010
Status
Member
Last seen
September 15, 2010
Aug 27, 2010 at 10:51 AM
Aug 27, 2010 at 10:51 AM
I found this code at ozgrid.com, How can I put this code into my code above?
Sub AutoFill()
Dim LastRowInA As Long
Dim r As Range
Set r = Range("d1:e1")
LastRowInA = Range("A65536").End(xlUp).Row
r.AutoFill Destination:=Range("d1:e" & LastRowInA)
End Sub
PLEASE HELP ME! Thanks in advance!!!!!!!!!
Sub AutoFill()
Dim LastRowInA As Long
Dim r As Range
Set r = Range("d1:e1")
LastRowInA = Range("A65536").End(xlUp).Row
r.AutoFill Destination:=Range("d1:e" & LastRowInA)
End Sub
PLEASE HELP ME! Thanks in advance!!!!!!!!!
https://www.ozgrid.com/forum/index.php?thread/90616-center-active-cell-s-contents-across-active-column-and-one-column-over/
Did you see this while you were visiting ozgrid?
Did you see this while you were visiting ozgrid?
DCecil07
Posts
30
Registration date
Monday March 15, 2010
Status
Member
Last seen
September 15, 2010
Aug 30, 2010 at 05:58 AM
Aug 30, 2010 at 05:58 AM
I am very new to VBA. Can someone tell me where I put that code into my code shown above?
DCecil07
Posts
30
Registration date
Monday March 15, 2010
Status
Member
Last seen
September 15, 2010
Aug 30, 2010 at 07:46 AM
Aug 30, 2010 at 07:46 AM
I figured it out, here is my new code....
Option Explicit
Sub PreparePTCI()
Dim wsNew As Worksheet
Dim LastRow As Long
LastRow = Range("C" & Rows.Count).End(xlUp).Row
With Columns("G:I").Select
Selection.Insert Shift:=xlToRight
Selection.ColumnWidth = 31.29
Selection.NumberFormat = "General"
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
Selection.Font.Bold = True
End With
Range("H2:H" & LastRow).FormulaR1C1 = "=RC[-5] & ""-"" & RC[-3] & ""-""& RC[-4]"
Range("G2:G" & LastRow).FormulaR1C1 = "=IF(RC[-1]="""",""Blank"",RC[-1])"
' TECI VLookup
Range("I2:I" & LastRow).FormulaR1C1 = "=VLOOKUP(RC[-1],TECI,MATCH(RC[-2],INDEX(TECI,1,),0),0)"
Set wsNew = Sheets.Add
With wsNew
.Name = "TECI"
.Tab.ColorIndex = 3
End With
End Sub
Option Explicit
Sub PreparePTCI()
Dim wsNew As Worksheet
Dim LastRow As Long
LastRow = Range("C" & Rows.Count).End(xlUp).Row
With Columns("G:I").Select
Selection.Insert Shift:=xlToRight
Selection.ColumnWidth = 31.29
Selection.NumberFormat = "General"
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
Selection.Font.Bold = True
End With
Range("H2:H" & LastRow).FormulaR1C1 = "=RC[-5] & ""-"" & RC[-3] & ""-""& RC[-4]"
Range("G2:G" & LastRow).FormulaR1C1 = "=IF(RC[-1]="""",""Blank"",RC[-1])"
' TECI VLookup
Range("I2:I" & LastRow).FormulaR1C1 = "=VLOOKUP(RC[-1],TECI,MATCH(RC[-2],INDEX(TECI,1,),0),0)"
Set wsNew = Sheets.Add
With wsNew
.Name = "TECI"
.Tab.ColorIndex = 3
End With
End Sub