vba 相对于单元格的偏移量

问题描述

我需要将一列数据复制到不同工作表上的另一列,仅粘贴值。适当的粘贴列在单个单元格中标识。每次应用宏时都会手动更改此单元格。所以有一次我可能想在第一列中复制/粘贴,所以我的标识符单元格是 1。下一次我可能在这个单元格中输入 5,这样我就向右偏移了 5 列来复制/粘贴数据。谢谢。

解决方法

您可以使用 Columns 属性引用工作表中的列。你可以用这样的代码实现我认为你想要做的事情。

import arcade

WINDOW = {"width":800,"height": 600,"title": ""}

class MyGame(arcade.Window):
    """
    Main application class.
    """

    def __init__(self):

        # Call the parent class and set up the window
        super().__init__(WINDOW['width'],WINDOW['height'],WINDOW['title'])

        arcade.set_background_color(arcade.csscolor.CORNFLOWER_BLUE)

    def setup(self):
        """ Set up the game here. Call this function to restart the game. """
        
        self.text = "Hello world!"

    def on_draw(self):
        """ Render the screen. """

        arcade.start_render()
        # Code to draw the screen goes here

        arcade.draw_text(self.text,WINDOW['width'] / 3 + (WINDOW['width'] / 3 / 3) - 20,WINDOW['height'] / 2,arcade.csscolor.WHITE,18)
    
    def on_mouse_release(self,x,y,button,key_modifiers):
        print("Clicked!")
        self.text = "Clicked!"

def main():
    """ Main method """
    window = MyGame()
    window.setup()
    arcade.run()


if __name__ == "__main__":
    main()