I am new to this but I have spent more than a day to find a solution on how to write this VBA code in Basic:
Code: Select all
Private Sub CommandButton1_Click()
Rem check which value control cells to move
If Range("'Ark1'!A11").Value = "Hulmur" Then
Application.EnableEvents = False
Rem this is my moving cells macro
Call Flyt_Hulmur
Application.EnableEvents = True
Else
Rem check which value control cells to move
If Range("'Ark1'!A11").Value = "Loftsrum" Then
Application.EnableEvents = False
Rem this is my moving cells macro
Call Flyt_Loftsrum
Application.EnableEvents = True
Else
Rem check which value control cells to move
If Range("'Ark1'!A11").Value = "Krybekælder" Then
Application.EnableEvents = False
Rem this is my moving cells macro
Call Flyt_Krybekælder
Application.EnableEvents = True
End If
End If
End If
Rem All actions on sheet 3 therefore - return to sheet 1
Sheets("Ark1").Select
End SubWhat I cannot figure out is how to write the same code in basic so I can use a button to do the same job in my OO calc spreadsheet.
I add a sample spreadsheet with macros moving cells dependent on the value of a specific cell just to give you the Picture of what is missing.
Namely the code that will move text depending on value of cell.