I'd like to select the column of cells beside a current region.
For example:
Range("A1").CurrentRegion.Select may highlight:
a) A1:H6, so I'd like to select I1:I6
b) A1:A1, so I'd like to select B1:B1
c) A1:A10, so I'd like to select B1:B10
etc.
Hello All,
I have a worksheet that has 2 identical regions (there a total of 2 different regions on this worksheet).
As you can see below, they appear identical. BUT...when clicking in the upper left hand corner of each region (at different times of course) they select different regions!
The first one is how it should be, selecting the row with "Totals" in it as the bottom most row of the current region
The second one, selects the 2 rows below the row with "Totals" in it and I can't figure out why
#
Color
Price
#
Color
Price
1
1
2
2
3
3
4
4
5
5
Totals
Totals
I don't know if anyone will be able to figure this one out without seeing it in Excel, but I'm hoping that I'm doing something dumb in this case.
Here's what I already did on the 2 rows below the row with "Totals" in it on the second diagram...
> I clicked on all 4 cells to see if any data is in there, and it shows nothing.
> I clicked on both trace dependents and trace precedents and nothing came up
> However, once I highlighted the 4 cells and cleared the contents on these 4 cells only, clicking in the upper/left most cell DID highlight the current region and STOPPED at totals, ignoring the 2 rows (4 cells) below it.
So, something MUST be in these 4 cells I just can't figure out what it is.
Note that this is part of a much larger scale macro that I'm doing and I need to figure this out so that I can re-establish the print area so that these blank rows don't print out.
Any help with this one would be appreciated!
Thanks much!
I am writing a macro to fill column E in this set of data, up to the length of the column of data in A. So the macro should read up to the last row in column A and fill that many rows in column E. So for example when I run the macro, it will read 12 rows for column A and fill all 12 of column E's row with say Tiger.
Code:
A B C D E
1 Dog Gecko Parrot
2 Dog Gecko Parrot
3 Dog Gecko Parrot
4 Dog Gecko Parrot
5 Dog Gecko Parrot
6 Gecko Cat
7 Dog Gecko
8 Dog Gecko cat
9 Dog Gecko
10 Dog Gecko
11 Dog Gecko Parrot
12 Dog cat
Any help would be appreciated.
Hi, in VBA when we use
With .Current Region, how can we amend the code so that it does not include the header row?
Sheet1
A
B
C
D
E
F
5
Header
Header
Header
Header
Header
Header
6
Data
Data
Data
Data
Data
Data
7
Data
Data
Data
Data
Data
Data
8
Data
Data
Data
Data
Data
Data
9
Data
Data
Data
Data
Data
Data
10
Data
Data
Data
Data
Data
Data
11
Data
Data
Data
Data
Data
Data
12
Data
Data
Data
Data
Data
Data
13
Data
Data
Data
Data
Data
Data
14
Data
Data
Data
Data
Data
Data
15
Data
Data
Data
Data
Data
Data
16
Data
Data
Data
Data
Data
Data
17
Data
Data
Data
Data
Data
Data
Excel tables to the web >> Excel Jeanie HTML 4
Hi,
How to get below output using VBA code, here I am trying highlight Header column and Total column in a sheet.
a
b
c
d
e
1
1
1
1
1
2
2
2
2
2
f
g
h
i
j
a
3
3
3
3
3
3
4
4
4
4
4
4
k
l
m
n
o
z
5
5
5
5
5
5
6
6
6
6
6
6
p
q
r
7
8
9
7
8
9
In a new purchase order database of mine, I add new items via a custom userform. Can I use "current region" to update the name of the expanded range each time "enter" is clicked, or do I need another method?
Good morning,
I've defined MyRange as Current region.
Now I want MyRange1 to be MyRange minus last row!
What is the simple VB syntax for that?
Thank you in advance.
I am looking to use a name facility for a current region in excel. I want to use the current region method as the range of cells will vary dependant on which weeks data is being presented.
sometimes it could be 7 columns and 300 rows then it could be 9 columns and 40000 rows.
Any guidance would be appreciated.
I have a worksheet with data in column A only. I would like to select the current region and then insert a new row between each cell. Each new row would hold the string "Made in America" in column A.
For Instance, I would start with this:
A1 = 03/17/07
A2 = 03/18/07
A3 = 03/19/07
A4 = 03/20/07
I need it to finish looking like this:
A1 = 03/17/07
A2 = Made in America
A3 = 03/18/07
A4 = Made in America
A5 = 03/19/07
A6 = Made in America
A7 = 03/20/07
A8 = Made in America
A couple of things to keep in mind. One, the number of dates in column A changes. Two, the worksheet is named ShoeConstr. Third, I really appreciate your help.
Darin
How can I use this code but tell it to select all but the right-most column?
Why?
I have this piece of code...
Code:
Set Rng = Range("A2")
Set RngEnd = Cells(Rows.Count, Rng.Column).End(xlUp)
Set Rng = IIf(RngEnd.Row < Rng.Row, Rng, Range(Rng, RngEnd))
Range("L2") = Rng.Rows.Count
which puts the results in L2.
The code below must come after the code above. So If I leave it as is, the code below then selects column L as part of the print area, which I don't want.
Code:
ActiveSheet.PageSetup.PrintArea = [A1].CurrentRegion.Address
Thanks much