Exporting Last line of data

iainIOW

New Member
Joined
Jan 27, 2005
Messages
8
Hi! My first post on this board..!!

Im looking to create a procedure in Excel that looks at the last row of a list of data and exports to bookmarks in Word. IM sure i have done this before, but have not come across the problem of variable cells..
My spreadsheet has 6 Columns, and data is entered in the cells below. At the moment, the user has to write the data out again in a word document (as a letter).

Anyone got any ideas on how to do this? Im more of an access VBA man, but unfortunatly my users dont have access!! :LOL:
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
hi

to get the bottom row used in the sheet

try

Code:
ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count - 1

jindon
 

iainIOW

New Member
Joined
Jan 27, 2005
Messages
8
comes back with "object does not support property or method" ive attached that code to the onclick property of a button on my sheet.
 

iainIOW

New Member
Joined
Jan 27, 2005
Messages
8
still comes back with the same, is this something to do with me using it with a button?
 

iainIOW

New Member
Joined
Jan 27, 2005
Messages
8
ttt

ive got all of the code to get the data over in to the right place in word.. i just cant get excel to work out that it needs to get data from the last row that has been used..

i.e i could code it to look like this: -

.Goto What:=wdGoToBookmark, Name:="Address2"
.TypeText Text:=Range("D2")

But obviously the range D2 wont always be the same, it will be Dn (where n is the last used row number)

Any ideas? appreciate your help.
 

Forum statistics

Threads
1,148,048
Messages
5,744,501
Members
423,881
Latest member
Nguyen Vu

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
Top