blaksnm
Well-known Member
- Joined
- Dec 15, 2009
- Messages
- 554
- Office Version
- 365
- Platform
- Windows
Hey guys
I have this dynamic range- starting in F7, number of rows will vary.
There should be no emty cells in the range.
Problem 1)
The range is generatet by copy/paste of a filtered range in a larger list.
When using this:
Range("F7").Select
Set tbl = ActiveCell.CurrentRegion
tbl.Offset(0, 0).Resize(tbl.Rows.Count, 1).Select
- I expect the dynamic range to be selected, but this does not happend
The macro obviously find some values in a larger range.
Problem 2)
My aim is to create/paste a formula in all corresponding cells in range G7:Gn - just for the valued celles in range F7:Fn
<TABLE style="WIDTH: 101pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=135><COLGROUP><COL style="WIDTH: 17pt; mso-width-source: userset; mso-width-alt: 1177" width=23><COL style="WIDTH: 42pt" span=2 width=56><TBODY><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; WIDTH: 17pt; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl69 height=18 width=23></TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; WIDTH: 42pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl67 width=56>"F"</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; WIDTH: 42pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl68 width=56>"G"</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>7 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SWL</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>8 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-171</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>9 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-170</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>10 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-074</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>11 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-072</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>12 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-070</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>13 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-066</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=18></TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8"></TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8"></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=18>n</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl71 colSpan=2>Variatiojn of rows</TD></TR></TBODY></TABLE>
If i manage to select the right range, Ill manage to make the formula-stuff
I have this dynamic range- starting in F7, number of rows will vary.
There should be no emty cells in the range.
Problem 1)
The range is generatet by copy/paste of a filtered range in a larger list.
When using this:
Range("F7").Select
Set tbl = ActiveCell.CurrentRegion
tbl.Offset(0, 0).Resize(tbl.Rows.Count, 1).Select
- I expect the dynamic range to be selected, but this does not happend
The macro obviously find some values in a larger range.
Problem 2)
My aim is to create/paste a formula in all corresponding cells in range G7:Gn - just for the valued celles in range F7:Fn
<TABLE style="WIDTH: 101pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=135><COLGROUP><COL style="WIDTH: 17pt; mso-width-source: userset; mso-width-alt: 1177" width=23><COL style="WIDTH: 42pt" span=2 width=56><TBODY><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; WIDTH: 17pt; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl69 height=18 width=23></TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; WIDTH: 42pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl67 width=56>"F"</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; WIDTH: 42pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl68 width=56>"G"</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>7 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SWL</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>8 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-171</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>9 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-170</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>10 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-074</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>11 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-072</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>12 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-070</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid" class=xl70 height=18>13 </TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl65>X-SI-066</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl66>Formula</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=18></TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8"></TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8"></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 13.5pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=18>n</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: #d8d8d8; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl71 colSpan=2>Variatiojn of rows</TD></TR></TBODY></TABLE>
If i manage to select the right range, Ill manage to make the formula-stuff