excel


How to copy the data in last row and copy to the last row of a table in the same worksheet automatically using excel vba?


I am trying to find way on how to select and copy the data from the last row (column F to I) to the last row of 'summary" table (column O to R). For now this is the code that i found but it seems that it can paste within the same range of column with different row. For example, it will copy data F38:I38 and paste the data at F40:I40. However, what i want is to copy data F38:I38 and the code will find the last row of 'summary'table and paste data F38:I38 to the last empty row. Is it possible to find two last row of the same worksheet but different number of cell? Is there any way i can automate this process?
Dim lastRowI As Integer
lastRowI = ws.Cells(Rows.Count, 6).End(xlUp).Row
ws.Activate
ws.Range(Cells(lastRowI, 6), Cells(lastRowI, 9)).Select
Selection.Copy
ws.Range(Cells(lastRowI + 2, 6), Cells(lastRowI + 2, 9)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Assuming that you have named your table "Summary",
The following code will take you to the last row of "Summary" table
ActiveSheet.Range("Summary").Select
Selection.End(xlDown).Select

Related Links

Excel remove text before last “|” character in string
Hide the ribbon in a worksheet, but not in the template it's based on
Hyperlink based on two dynamic cell values
Excel - Determine if value is contain in named range
Writing excel functions in vba
I need to be able to select columns in Excel by specifying column numbers in vba
How to update a specific row of a table in Excel using Microsoft Graph?
columns' values based on specific rows in pivot table excel
VBA Adding cells from one sheet to another by cell
Searchng a sheet for a value and returning row & column numbers
How to take a control of specific cell of XL?
Vlookup exact text on a cell text string
HTTP GET responds with empty body, downloads excel document in IE
VBA replace comma with line break in word?
Excel online sharing
Change cell value based off of selection from ListBox

Categories

HOME
node.js
cordova
hyper-v
logic
neural-network
highcharts
asp-classic
metal
animate.css
external
sage
geometry
fontforge
unity3d-unet
zillow
media
probability-theory
greedy
powerpoint-vba
jsx
remote-connections
week-number
product-key
rrd4j
jenkinsfile
libphonenumber
lighttable
slam
angular-chart
bandwidth
behavior
orders
knockout-validation
vorlon
mongodb-scala
optional
cscope
google-api-v3
sequencing
twebbrowser
nested-forms
ienumerable
iterm
network-monitoring
cosmos
payara
stompjs
bullseye
ssas-2008
tap
seeding
image-manipulation
filefield
unassigned-variable
appcompat-v7-r22.1
usleep
duplicate-removal
option
avassetwriter
presentmodalviewcontrolle
stencils
tiles2
opengl-es-1.1
backbone-forms
circusd
converters
icefaces-1.8
static-array
camping
alpha-five
happstack
nested-queries
sts-securitytokenservice
entityreference
dft
alasset
microsoft.build
progressive-enhancement

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile