A little help finding if a cell is populated or not.

Badassack

New Member
Joined
Feb 26, 2014
Messages
36
In the following code I"m trying to find out if column "A" has a value, if so then fill in the rest of the columns with data.
What do I need to do? Thanks for your help.

Worksheets("data").Activate
If Range("a3", Range("a2").End(xlDown)).Value = True Then <------------this line is the problem.
Range("b3", Range("b2").End(xlDown)).Value = txtautoinput1
Range("c3", Range("c2").End(xlDown)).Value = txtautoinput1count
Range("d3", Range("d2").End(xlDown)).Value = txtautoinput2
Range("e3", Range("e2").End(xlDown)).Value = txtautoinput2count
Range("f3", Range("f2").End(xlDown)).Value = txtautoinput3
Range("g3", Range("g2").End(xlDown)).Value = txtautoinput3count
Range("h3", Range("h2").End(xlDown)).Value = txtautooutput
Range("i3", Range("i2").End(xlDown)).Value = cbocraftingmethod1
Range("j3", Range("j2").End(xlDown)).Value = cbogroupone2
Range("k3", Range("k2").End(xlDown)).Value = cbogrouptwo2
Range("l1").Select
End If
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
In the following code I"m trying to find out if column "A" has a value, if so then fill in the rest of the columns with data.
What do I need to do? Thanks for your help.

Worksheets("data").Activate
If Range("a3", Range("a2").End(xlDown)).Value = True Then <------------this line is the problem.
Range("b3", Range("b2").End(xlDown)).Value = txtautoinput1
Range("c3", Range("c2").End(xlDown)).Value = txtautoinput1count
Range("d3", Range("d2").End(xlDown)).Value = txtautoinput2
Range("e3", Range("e2").End(xlDown)).Value = txtautoinput2count
Range("f3", Range("f2").End(xlDown)).Value = txtautoinput3
Range("g3", Range("g2").End(xlDown)).Value = txtautoinput3count
Range("h3", Range("h2").End(xlDown)).Value = txtautooutput
Range("i3", Range("i2").End(xlDown)).Value = cbocraftingmethod1
Range("j3", Range("j2").End(xlDown)).Value = cbogroupone2
Range("k3", Range("k2").End(xlDown)).Value = cbogrouptwo2
Range("l1").Select
End If

Well I got the answer I was looking for from a Wise Owl. Here is the code the way I intended it to be.

Dim rowcount As Long
rowcount = Range("a3", Range("a2").End(xlDown)).Cells.Count

Range("b3", Range("b2").Offset(rowcount, 0)).Value = txtautoinput1
Range("c3", Range("c2").Offset(rowcount, 0)).Value = txtautoinput1count
Range("d3", Range("d2").Offset(rowcount, 0)).Value = txtautoinput2
Range("e3", Range("e2").Offset(rowcount, 0)).Value = txtautoinput2count
Range("f3", Range("f2").Offset(rowcount, 0)).Value = txtautoinput3
Range("g3", Range("g2").Offset(rowcount, 0)).Value = txtautoinput3count
Range("h3", Range("h2").Offset(rowcount, 0)).Value = txtautooutput
Range("i3", Range("i2").Offset(rowcount, 0)).Value = cbocraftingmethod1
Range("j3", Range("j2").Offset(rowcount, 0)).Value = cbogroupone2
Range("k3", Range("k2").Offset(rowcount, 0)).Value = cbogrouptwo2
Range("l1").Select
 
Upvote 0

Forum statistics

Threads
1,223,250
Messages
6,171,036
Members
452,374
Latest member
keccles

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
Back
Top