I use a worksheet whith 30 columns to have control over water bill. (the same for electricity bill)
And I'll do it one time a month.
For each time I want to have formulas ready in last row. I mean for this month I click a button and I'll have the row ready to work. Lets say column C with =B-A...
Ok - I do this for several colluns
i = 8
While Cells(i, 1) <> ""
i = i + 1
Wend
i = i - 1
Cells(i, 2).Select
Rows(i).Select
Selection.Insert Shift:=xlDown
'for cells with operations
Cells(i - 1, 1).Select
Selection.Copy
Range(Cells(i, 1), Cells(i + 1, 1)).Select
ActiveSheet.Paste
'for cells...
SkipVought I use a worksheet whith 30 columns to have control over water and electricity bills.
First I insert a row before the last used row and then I have to copy several cells. some from the last row and others from the row before.
Now I have to do this cell by cell because they are no...
Why?
I tried
Application.Union(Cells(i + 1, 1), Cells(i + 1, 3)).Copy
Application.Union(Cells(i, 1), Cells(i, 3)).Select
With this the cells (i,1) and cells (i,3) are select
then with EDIT PAST
return a error: that command cannot be used on multiple selections
Application.Union(Cells(i + 1, 1), Cells(i + 1, 3)).Copy
I just tried this and only copy Cells(i + 1, 1)----A2
Returns no error but don't make copy of cells(i+1,3) just for the first one.
To SkipVought again
Of course this code works
Union(Range("F23:G23"), Range("J23")).Copy
But when I tried this I get a error -- Methode Range of object _Global failed
Application.Union (Range(Cells(i + 1, 1))), Range((Cells(i + 1, 3))).Copy
So in that case it don't work?
to SkipVought
You said:
"YOU could answer that question YOUSELF, by trying to COPY multiple, non-contiguous cells"
I tried and it works. I have recorded a macro but can´t do the same in VB.
Range("F23:G23,J23").Select
Selection.Copy
Thanks
I'm so sorry but I can't get the answer for this:
i = 9
While Cells(i, 1) <> ""
i = i + 1
Wend
i = i - 1
Rows(i).Select
Selection.Insert Shift:=xlDown
Application.Union(Range(i,2: i,3), Range(i, 5)).Copy
Can you point me for how to do?
davedave24
is not a all range I need
as you said is all range: i1,i2,i3,i4,i5
What I ask is for no adjacent cells like i1,i3,i5
Cells(i, 1).Select
Selection.Copy
Cells(i, 3).Select
Selection.Copy
Do I have to do like this or can I do in one statement?
Cells i1,i3,i5.......select
Selection.Copy
Hi
We can select cells. I do like this:
Cells(i, 2).Select
Selection.Copy
Can I select cells (i,2) (i,3) (i,5) in one statement?(non adjacent cells)
cells (i,2) (i,3) (i,5). select
Selection.copy
thanks
Hi
I have this code:
Range(Cells(i - 1, 1), Cells(i - 1, 42)).AutoFill Destination:=Range(Cells(i - 1, 1), Cells(i, 42)), Type:=xlFillDefault
With this code I would like to copy but it makes a list. I mean I have in a cell 0,25 .
When I run a code it fills 1,25 --- 2,25 and I would like to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.