Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2018, 02:31 AM
cosmicyes cosmicyes is offline Select a row in a different tab Windows 7 64bit Select a row in a different tab Office 2013
Novice
Select a row in a different tab
 
Join Date: Jan 2018
Posts: 8
cosmicyes is on a distinguished road
Default Select a row in a different tab

Hello,


I wrote a very little VBA-Script.
I have a button in a sheet.
When I click this button I want to select the second row in another sheet to freeze it.


This is my script:
Code:
Sub ErsteZeileEinfrieren() '(2)
    'friert die erste Zeile ein
    Worksheets(1).Activate
    Rows("2:2").Select
    ActiveWindow.FreezePanes = True
End Sub
The line "Rows("2:2").Select however does not work.


I get this error (german):

"Laufzeitfehler '1004':
Die Select-Methode des Range-Objektes konnte nicht ausgeführt werden."



Does anybody have any hints?
Reply With Quote
  #2  
Old 07-09-2018, 02:47 AM
cosmicyes cosmicyes is offline Select a row in a different tab Windows 7 64bit Select a row in a different tab Office 2013
Novice
Select a row in a different tab
 
Join Date: Jan 2018
Posts: 8
cosmicyes is on a distinguished road
Default

ooops... got it


Code:
Sub ErsteZeileEinfrieren() '(2)
    'friert die erste Zeile ein
    Worksheets(1).Activate
    Application.Sheets(1).Rows("2:2").Select
    ActiveWindow.FreezePanes = True
End Sub

I thought I tried this before...
Reply With Quote
Reply

Tags
select row freeze



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select pasted ArtKilp Word 2 08-10-2017 07:23 AM
Cant select shape! Please help! Philosofen Word 1 03-07-2017 07:03 AM
Select a row in a different tab How to select row aymanharake Excel Programming 3 02-18-2017 04:09 PM
Select a row in a different tab How to select different words at once FTL Word 5 03-08-2016 06:10 PM
Select a row in a different tab select all tables majed_m Word VBA 5 07-30-2015 03:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft