UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Macro Range, Office 2013    
 
   
netrn
post Oct 9 2019, 01:11 PM
Post#1



Posts: 144
Joined: 30-November 03
From: OH, USA


I am wrapping single quotes around values in a list of cells. I used the macro recorder to record my steps. The macro is specifying that after it wraps quotes around the cell to the left, it jumps to B2. Is there a way to jump to the cell below, instead of specifically B2? I use this macro in different columns. Same with the specification of the autofill for B2:B3 and jumping to B4. Thanks for your help!

CODE
Sub quoted_list()
' quoted_list Macro
    ActiveCell.FormulaR1C1 = "=""'""&RC[-1]&""'"""
    Range("B2").Select
    Selection.AutoFill Destination:=Range("B2:B3"), Type:=xlFillDefault
    Range("B2:B3").Select
    Range("B3").Select
    ActiveCell.FormulaR1C1 = "="",'""&RC[-1]&""'"""
    Range("B4").Select
End Sub
Go to the top of the page
 
June7
post Oct 9 2019, 04:29 PM
Post#2



Posts: 867
Joined: 25-January 16



What exactly are you trying to accomplish?

If you explicitly specify row to fill, why not explicitly specify next cell?

It is possible to do things to cells when they aren't actually selected. Recorded code would have to be modified.

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
netrn
post Oct 9 2019, 07:14 PM
Post#3



Posts: 144
Joined: 30-November 03
From: OH, USA


I'm trying to not explicitly specify the row to fill. I want this macro to work anywhere I start it.
Go to the top of the page
 
WildBird
post Oct 9 2019, 07:21 PM
Post#4


UtterAccess VIP
Posts: 3,620
Joined: 19-August 03
From: Auckland, Little Australia


You could get the row address, and assign it to a variable, and then add 1 to that variable and use that.

Does this make sense?


--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 
WildBird
post Oct 9 2019, 07:32 PM
Post#5


UtterAccess VIP
Posts: 3,620
Joined: 19-August 03
From: Auckland, Little Australia


What in simple terms is it that you want to do? FormulaR1C1 is so hard to follow at times that I prefer to use "A1" type address instead.




--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    15th October 2019 - 03:46 AM