Defining Dynamic Ranges in Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a data worksheet in which I have to update record using a different
sheet (form for data entry).

I recorded a Macro where by records were copied from the form sheet , and
copied after the last record in data sheet. ( Say the last record was in row
10, so the data has to be updated in row 11)

But when the macro is recorded the number for the last row which was updated
while recording gets fixed (in this case row 11) , therefore when the macro
is rerun everytime row 11 is updated.

I require that this number should be generated after looking at data sheet
and identifying the last row record.

If anyone can help.....
 
Typically we use the equivalent of the keyboard Ctrl-Arrow to find the next
empty cell:

Range("A1").End(xlDown).Offset(1).Select

This assumes at least A1 and A2 have entries.

--
Jim Rech
Excel MVP
|
| I have a data worksheet in which I have to update record using a different
| sheet (form for data entry).
|
| I recorded a Macro where by records were copied from the form sheet , and
| copied after the last record in data sheet. ( Say the last record was in
row
| 10, so the data has to be updated in row 11)
|
| But when the macro is recorded the number for the last row which was
updated
| while recording gets fixed (in this case row 11) , therefore when the
macro
| is rerun everytime row 11 is updated.
|
| I require that this number should be generated after looking at data sheet
| and identifying the last row record.
|
| If anyone can help.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top