473,327 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

keep value of a cell and go to requested cell

1
Hello!

I have a preadsheet where I regulary insert new rows and add some extra cells to the them. The new rows may already exists. I solved that the new rows get the info from the previous ones throgh function.

Now I want to delete the previous rows, I face 2 problems.
1) I loose the values of extra cells in the last rows as I delete the previous row *
2) I cannot go to and come back from the last row automatically to set the value. **

Please help.



Private Sub deletepreviousrange_Click()
MsgBox ("I delete previous addresses!")
Dim alfa
Dim beta
Dim gamma
Dim omega
Dim atlas
alfa = ActiveCell.value
beta = ActiveCell.Offset(0, -4).value
omega = ActiveCell.Offset(0, 3).value
gamma = ActiveCell.Row

Range("tel_1").Activate
While ActiveCell.value <> ""
If ActiveCell.value = beta Then
MsgBox ("I found a previous one")
ActiveCell.Offset(0, 4).Select
Selection.Copy


ActiveCell.Offset(8, 0).Select **
Selection.PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(-8, -4).Select **

If ActiveCell.value = beta Then
Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 28)).Select

If ActiveCell.Row < gamma Then
Selection.Delete *
gamma = gamma - 1
End If
If ActiveCell.Row = gamma Then
MsgBox ("Only the last one remained")
End If
ActiveCell.Offset(0, 19).Select
End If
End If
ActiveCell.Offset(1, 0).Select
Wend
End Sub
Sep 26 '07 #1
0 807

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: solartimba | last post by:
I am using the advance() auxiliary STL iterator function to move a map iter forward, but I read that there is no check to keep the iter from pointing past the end of the map. How is this problem...
5
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial...
2
by: kscdavefl | last post by:
I have a column on a web page datagrid that contains a value. I want to take the value and populate another cell on the grid. If the value in cell number 6 is 0 I want to make the value in cell 1...
4
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific...
1
by: qiong | last post by:
Dear friends, Good evening, I have some problems with finding keyword ":\" for each cell. My objective is to find that keyword in each cell in each worksheet which represent the link. Eg:...
3
by: Bill Gower | last post by:
I have an cell which contains a field member which is filled with String.Empty. When I retrieve the value in the cell with Cells.Text.ToString() and try to compare it to String.Empty, I can't...
4
by: NvrBst | last post by:
I have a log viewer. I sort the DataGridView by the Time Column and then run a function to set all cell backcolors depending if the cell above is different. This works correctly, however, when...
1
by: gbengston | last post by:
Please look at my example, I have a script that pulls the value of one cell and inserts it into an input box in another cell. My problem is that the source cell is itself an input box so when I pull...
1
by: swetha123 | last post by:
hello , I need to alert the value entered in the text box,which is in TD cell, using DOM can any one tell how please here is the code with out a text box which is working <html> <head> ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.