excel - Code to Select the first cell in a row after a loop finishes -


i working loop macro copies data until cell blank.

once cell blank, want macro select cell in column a, in same row loop criteria satisfied.

this have, loop macro works fine when tried code macro select cell error.

range("c8:v8").select selection.copy activecell.offset(1, 0).range("a1").select activesheet.paste  loop until activecell.offset(-1, 15) = ""  activecell.offset(1, -6).range("a1").select  end sub 

i'm having trouble understanding you're trying copy/paste, line select cell in column a, last row in spreadsheet:

range(cells(activesheet.usedrange.rows.count + 1, 1), cells(activesheet.usedrange.rows.count + 1, 1)).select 

if doesn't achieve looking for, showing data copying/looping through helpful.

it seems loop should never end in code, however, since end condition activecell.offset(-1, 15) looks finished copying contents cells "c8:v8".

at end, error selecting activecell.offset(1, -6).range("a1") because trying select 6 columns left of original selection, began @ column 3 (aka c).

it seems problem might stem misunderstanding of how activecell.offset().range("") syntax works. recommend answer in post if that's case -> i need interpretation of activecell.offset in vba


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -