excel - concatenation until empty cell -


i've made code concatenate 3 columns namely yr corresponds cell a2, jj corresponds cell b2 , ya corresponds cell d2. when clicked button want display answer g2. here's code:

sub button1_click() dim yr string dim jj string dim ya string dim rf string  yr = range("a2") jj = range("b2") ya = range("d2") rf = yr & "." & jj & "." & ya range("g2") = rf  end sub 

my problem how can made code work until there's blank cell?? i've search code regarding is:

range("a1").select  until isempty(activecell.value)  ‘codes here activecell.offset(1,0).select  loop 

how can made code , in advanced!

try below code if don't wanna loop.

sub button1_click()      dim lastrow long     lastrow = range("a" & rows.count).end(xlup).row     range("g2:g" & lastrow).formular1c1 = "=rc[-6] & ""."" & rc[-5] & ""."" & rc[-3]"  end sub 

enter image description here


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -